LibreOffice Module svx (master) 1
chinese_dictionarydialog.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
23#include <com/sun/star/i18n/TextConversionOption.hpp>
24#include <com/sun/star/linguistic2/ConversionDictionaryType.hpp>
25#include <com/sun/star/linguistic2/ConversionPropertyType.hpp>
26#include <com/sun/star/linguistic2/ConversionDictionaryList.hpp>
27#include <com/sun/star/linguistic2/XConversionPropertyType.hpp>
28#include <com/sun/star/util/XFlushable.hpp>
29#include <com/sun/star/lang/Locale.hpp>
30#include <o3tl/safeint.hxx>
31#include <unotools/lingucfg.hxx>
33#include <utility>
34#include <osl/diagnose.h>
35
37{
38
39using namespace ::com::sun::star;
40using namespace ::com::sun::star::uno;
41
42DictionaryList::DictionaryList(std::unique_ptr<weld::TreeView> xControl)
43 : m_xControl(std::move(xControl))
44 , m_xIter(m_xControl->make_iterator())
45 , m_pED_Term(nullptr)
46 , m_pED_Mapping(nullptr)
47 , m_pLB_Property(nullptr)
48{
49 m_xControl->make_sorted();
50}
51
52OUString DictionaryList::getPropertyTypeName( sal_Int16 nConversionPropertyType ) const
53{
55 return OUString();
56
57 sal_uInt16 nPos = static_cast<sal_uInt16>( nConversionPropertyType )-1;
58 if (nPos < m_pLB_Property->get_count())
60 return m_pLB_Property->get_text(0);
61}
62
64{
65 if (!m_xDictionary.is())
66 return;
67
68 Reference< linguistic2::XConversionPropertyType > xPropertyType( m_xDictionary, uno::UNO_QUERY );
69
70 sal_Int32 nN;
72
73 for( nN = m_aToBeDeleted.size(); nN--; )
74 {
75 pE = m_aToBeDeleted[nN];
76 m_xDictionary->removeEntry( pE->m_aTerm, pE->m_aMapping );
77 }
78 int nRowCount = m_xControl->n_children();
79 for( nN = nRowCount; nN--; )
80 {
81 pE = getEntryOnPos( nN );
82 if(pE->m_bNewEntry)
83 {
84 try
85 {
86 m_xDictionary->addEntry( pE->m_aTerm, pE->m_aMapping );
87 xPropertyType->setPropertyType( pE->m_aTerm, pE->m_aMapping, pE->m_nConversionPropertyType );
88 }
89 catch( uno::Exception& )
90 {
91
92 }
93 }
94 }
95 Reference< util::XFlushable > xFlush( m_xDictionary, uno::UNO_QUERY );
96 if( xFlush.is() )
97 xFlush->flush();
98}
99
101{
102 sal_Int32 nN;
103 int nRowCount = m_xControl->n_children();
104 for( nN = nRowCount; nN--; )
105 deleteEntryOnPos( nN );
106 for( nN = m_aToBeDeleted.size(); nN--; )
107 {
109 delete pE;
110 }
111 m_aToBeDeleted.clear();
112}
113
114void DictionaryList::refillFromDictionary( sal_Int32 nTextConversionOptions )
115{
116 deleteAll();
117
118 if(!m_xDictionary.is())
119 return;
120
121 const Sequence< OUString > aLeftList( m_xDictionary->getConversionEntries( linguistic2::ConversionDirection_FROM_LEFT ) );
122
123 Reference< linguistic2::XConversionPropertyType > xPropertyType( m_xDictionary, uno::UNO_QUERY );
124
125 OUString aRight;
126 sal_Int16 nConversionPropertyType;
127
128 for(const OUString& aLeft : aLeftList)
129 {
130 Sequence< OUString > aRightList( m_xDictionary->getConversions(
131 aLeft, 0, aLeft.getLength()
132 , linguistic2::ConversionDirection_FROM_LEFT, nTextConversionOptions ) );
133
134 if(aRightList.getLength()!=1)
135 {
136 OSL_FAIL("The Chinese Translation Dictionary should have exactly one Mapping for each term.");
137 continue;
138 }
139
140 aRight = aRightList[0];
141 nConversionPropertyType = linguistic2::ConversionPropertyType::OTHER;
142 if(xPropertyType.is())
143 nConversionPropertyType = xPropertyType->getPropertyType(aLeft, aRight);
144
145 DictionaryEntry* pEntry = new DictionaryEntry( aLeft, aRight, nConversionPropertyType );
146
147 m_xControl->append(m_xIter.get());
148 m_xControl->set_text(*m_xIter, pEntry->m_aTerm, 0);
149 m_xControl->set_text(*m_xIter, pEntry->m_aMapping, 1);
151 m_xControl->set_id(*m_xIter, weld::toId(pEntry));
152 }
153}
154
156{
157 DictionaryEntry* pRet=nullptr;
158 int nN = m_xControl->get_selected_index();
159 if (nN != -1)
160 pRet = getEntryOnPos( nN );
161 return pRet;
162}
163
165{
166 OUString sLBEntry = m_xControl->get_id(nPos);
167 return weld::fromId<DictionaryEntry*>(sLBEntry);
168}
169
170DictionaryEntry* DictionaryList::getTermEntry( std::u16string_view rTerm ) const
171{
172 int nRowCount = m_xControl->n_children();
173 for( sal_Int32 nN = nRowCount; nN--; )
174 {
176 if( pE && rTerm == pE->m_aTerm )
177 return pE;
178 }
179 return nullptr;
180}
181
182bool DictionaryList::hasTerm( std::u16string_view rTerm ) const
183{
184 return getTermEntry(rTerm) !=nullptr ;
185}
186
187void DictionaryList::addEntry(const OUString& rTerm, const OUString& rMapping,
188 sal_Int16 nConversionPropertyType, int nPos)
189{
190 if( hasTerm( rTerm ) )
191 return;
192
193 DictionaryEntry* pEntry = new DictionaryEntry( rTerm, rMapping, nConversionPropertyType, true );
194 m_xControl->insert(nPos, m_xIter.get());
195 m_xControl->set_text(*m_xIter, pEntry->m_aTerm, 0);
196 m_xControl->set_text(*m_xIter, pEntry->m_aMapping, 1);
198 m_xControl->set_id(*m_xIter, weld::toId(pEntry));
199 m_xControl->select(*m_xIter);
200}
201
203{
205 m_xControl->remove(nPos);
206 if (pEntry)
207 {
208 if( pEntry->m_bNewEntry )
209 delete pEntry;
210 else
211 m_aToBeDeleted.push_back( pEntry );
212 }
213}
214
215int DictionaryList::deleteEntries( std::u16string_view rTerm )
216{
217 int nPos = -1;
218 int nRowCount = m_xControl->n_children();
219 for (sal_Int32 nN = nRowCount; nN--;)
220 {
221 DictionaryEntry* pCurEntry = getEntryOnPos( nN );
222 if( rTerm == pCurEntry->m_aTerm )
223 {
224 nPos = nN;
225 m_xControl->remove(nN);
226 if( pCurEntry->m_bNewEntry )
227 delete pCurEntry;
228 else
229 m_aToBeDeleted.push_back( pCurEntry );
230 }
231 }
232 return nPos;
233}
234
235DictionaryEntry::DictionaryEntry( OUString aTerm, OUString aMapping
236 , sal_Int16 nConversionPropertyType
237 , bool bNewEntry )
238 : m_aTerm(std::move( aTerm ))
239 , m_aMapping(std::move( aMapping ))
240 , m_nConversionPropertyType( nConversionPropertyType )
241 , m_bNewEntry( bNewEntry )
242{
245}
246
248{
249}
250
251IMPL_LINK_NOARG(ChineseDictionaryDialog, SizeAllocHdl, const Size&, void)
252{
253 DictionaryList* pControl = m_xCT_DictionaryToTraditional->get_visible() ?
254 m_xCT_DictionaryToTraditional.get() :
255 m_xCT_DictionaryToSimplified.get();
256 std::vector<int> aWidths;
257 int x1, x2, y, width, height;
258 if (!m_xED_Mapping->get_extents_relative_to(pControl->get_widget(), x1, y, width, height))
259 return;
260 aWidths.push_back(x1);
261 if (!m_xLB_Property->get_extents_relative_to(pControl->get_widget(), x2, y, width, height))
262 return;
263 aWidths.push_back(x2 - x1);
264 m_xCT_DictionaryToTraditional->get_widget().set_column_fixed_widths(aWidths);
265 m_xCT_DictionaryToSimplified->get_widget().set_column_fixed_widths(aWidths);
266}
267
268void DictionaryList::init(const Reference< linguistic2::XConversionDictionary>& xDictionary,
269 weld::Entry *pED_Term, weld::Entry *pED_Mapping, weld::ComboBox *pLB_Property)
270{
271 if (m_xDictionary.is())
272 return;
273
274 m_xDictionary = xDictionary;
275
276 m_pED_Term = pED_Term;
277 m_pED_Mapping = pED_Mapping;
278 m_pLB_Property = pLB_Property;
279
280 m_xControl->set_sort_column(0);
281 m_xControl->set_sort_indicator(TRISTATE_TRUE, 0);
282
283 std::vector<int> aWidths
284 {
285 o3tl::narrowing<int>(m_pED_Term->get_preferred_size().Width()),
286 o3tl::narrowing<int>(m_pED_Mapping->get_preferred_size().Width())
287 };
288 m_xControl->set_column_fixed_widths(aWidths);
289}
290
292 const Reference< linguistic2::XConversionDictionary>& xDictionary)
293{
294 //set widgets to track the width of for columns
295 pList->init(xDictionary,
296 m_xED_Term.get(), m_xED_Mapping.get(), m_xLB_Property.get());
297}
298
300 : GenericDialogController(pParent, "svx/ui/chinesedictionary.ui", "ChineseDictionaryDialog")
301 , m_nTextConversionOptions(i18n::TextConversionOption::NONE)
302 , m_xRB_To_Simplified(m_xBuilder->weld_radio_button("tradtosimple"))
303 , m_xRB_To_Traditional(m_xBuilder->weld_radio_button("simpletotrad"))
304 , m_xCB_Reverse(m_xBuilder->weld_check_button("reverse"))
305 , m_xFT_Term(m_xBuilder->weld_label("termft"))
306 , m_xED_Term(m_xBuilder->weld_entry("term"))
307 , m_xFT_Mapping(m_xBuilder->weld_label("mappingft"))
308 , m_xED_Mapping(m_xBuilder->weld_entry("mapping"))
309 , m_xFT_Property(m_xBuilder->weld_label("propertyft"))
310 , m_xLB_Property(m_xBuilder->weld_combo_box("property"))
311 , m_xCT_DictionaryToSimplified(new DictionaryList(m_xBuilder->weld_tree_view("tradtosimpleview")))
312 , m_xCT_DictionaryToTraditional(new DictionaryList(m_xBuilder->weld_tree_view("simpletotradview")))
313 , m_xPB_Add(m_xBuilder->weld_button("add"))
314 , m_xPB_Modify(m_xBuilder->weld_button("modify"))
315 , m_xPB_Delete(m_xBuilder->weld_button("delete"))
316{
317 m_xCT_DictionaryToSimplified->set_size_request(-1, m_xCT_DictionaryToSimplified->get_height_rows(8));
318 m_xCT_DictionaryToTraditional->set_size_request(-1, m_xCT_DictionaryToTraditional->get_height_rows(8));
319
320 SvtLinguConfig aLngCfg;
321 bool bValue;
322 Any aAny( aLngCfg.GetProperty( UPN_IS_REVERSE_MAPPING ) );
323 if( aAny >>= bValue )
324 m_xCB_Reverse->set_active( bValue );
325
326 m_xLB_Property->set_active(0);
327
328 Reference< linguistic2::XConversionDictionary > xDictionary_To_Simplified;
329 Reference< linguistic2::XConversionDictionary > xDictionary_To_Traditional;
330 //get dictionaries
331 {
332 if(!m_xContext.is())
333 m_xContext.set( ::cppu::defaultBootstrap_InitialComponentContext() );
334 if(m_xContext.is())
335 {
336 Reference< linguistic2::XConversionDictionaryList > xDictionaryList = linguistic2::ConversionDictionaryList::create(m_xContext);
337 Reference< container::XNameContainer > xContainer( xDictionaryList->getDictionaryContainer() );
338 if(xContainer.is())
339 {
340 try
341 {
342 OUString aNameTo_Simplified("ChineseT2S");
343 OUString aNameTo_Traditional("ChineseS2T");
344 lang::Locale aLocale;
345 aLocale.Language = "zh";
346
347 if( xContainer->hasByName( aNameTo_Simplified ) )
348 xDictionary_To_Simplified.set(
349 xContainer->getByName( aNameTo_Simplified ), UNO_QUERY );
350 else
351 {
352 aLocale.Country = "TW";
353 xDictionary_To_Simplified =
354 xDictionaryList->addNewDictionary( aNameTo_Simplified
355 , aLocale, linguistic2::ConversionDictionaryType::SCHINESE_TCHINESE
356 );
357 }
358 if (xDictionary_To_Simplified.is())
359 xDictionary_To_Simplified->setActive( true );
360
361
362 if( xContainer->hasByName( aNameTo_Traditional ) )
363 xDictionary_To_Traditional.set(
364 xContainer->getByName( aNameTo_Traditional ), UNO_QUERY );
365 else
366 {
367 aLocale.Country = "CN";
368 xDictionary_To_Traditional =
369 xDictionaryList->addNewDictionary( aNameTo_Traditional
370 ,aLocale, linguistic2::ConversionDictionaryType::SCHINESE_TCHINESE);
371 }
372 if (xDictionary_To_Traditional.is())
373 xDictionary_To_Traditional->setActive( true );
374
375 }
376 catch(const uno::Exception& )
377 {
378 }
379 }
380 }
381 }
382
383 //init dictionary controls
384 initDictionaryControl(m_xCT_DictionaryToSimplified.get(), xDictionary_To_Simplified);
385 initDictionaryControl(m_xCT_DictionaryToTraditional.get(), xDictionary_To_Traditional);
386
387 //set hdl
388 m_xCT_DictionaryToSimplified->connect_column_clicked(LINK(this, ChineseDictionaryDialog, ToSimplifiedHeaderBarClick));
389 m_xCT_DictionaryToTraditional->connect_column_clicked(LINK(this, ChineseDictionaryDialog, ToTraditionalHeaderBarClick));
390
392
393 m_xED_Term->connect_changed( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) );
394 m_xED_Mapping->connect_changed( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) );
395 m_xLB_Property->connect_changed( LINK( this, ChineseDictionaryDialog, EditFieldsListBoxHdl ) );
396
397 m_xRB_To_Simplified->connect_toggled( LINK( this, ChineseDictionaryDialog, DirectionHdl ) );
398
399 m_xCT_DictionaryToSimplified->connect_changed( LINK( this, ChineseDictionaryDialog, MappingSelectHdl ));
400 m_xCT_DictionaryToTraditional->connect_changed( LINK( this, ChineseDictionaryDialog, MappingSelectHdl ));
401
402 m_xPB_Add->connect_clicked( LINK( this, ChineseDictionaryDialog, AddHdl ) );
403 m_xPB_Modify->connect_clicked( LINK( this, ChineseDictionaryDialog, ModifyHdl ) );
404 m_xPB_Delete->connect_clicked( LINK( this, ChineseDictionaryDialog, DeleteHdl ) );
405
406 m_xED_Mapping->connect_size_allocate(LINK(this, ChineseDictionaryDialog, SizeAllocHdl));
407 m_xLB_Property->connect_size_allocate(LINK(this, ChineseDictionaryDialog, SizeAllocHdl));
408}
409
411{
412}
413
414void ChineseDictionaryDialog::setDirectionAndTextConversionOptions( bool bDirectionToSimplified, sal_Int32 nTextConversionOptions /*i18n::TextConversionOption*/ )
415{
416 if( bDirectionToSimplified == m_xRB_To_Simplified->get_active()
417 && nTextConversionOptions == m_nTextConversionOptions )
418 return;
419
420 m_nTextConversionOptions = nTextConversionOptions;
421
422 if (bDirectionToSimplified)
423 m_xRB_To_Simplified->set_active(true);
424 else
425 m_xRB_To_Traditional->set_active(true);
427}
428
430{
431 updateAfterDirectionChange();
432}
433
435{
436 Reference< linguistic2::XConversionDictionary > xDictionary;
437
438 if (m_xRB_To_Simplified->get_active())
439 {
442 xDictionary = m_xCT_DictionaryToSimplified->m_xDictionary;
443 }
444 else
445 {
448 xDictionary = m_xCT_DictionaryToTraditional->m_xDictionary;
449 }
450
452}
453
455{
456 updateButtons();
457}
458
460{
461 updateButtons();
462}
463
465{
466 DictionaryEntry* pE = getActiveDictionary().getFirstSelectedEntry();
467 if (pE)
468 {
469 m_xED_Term->set_text( pE->m_aTerm );
470 m_xED_Mapping->set_text( pE->m_aMapping );
471 sal_Int16 nPos = pE->m_nConversionPropertyType-1;
472 if (nPos<0 || nPos>=m_xLB_Property->get_count())
473 nPos=0;
474 if (m_xLB_Property->get_count())
475 m_xLB_Property->set_active(nPos);
476 }
477
478 updateButtons();
479}
480
482{
483 return !m_xED_Term->get_text().isEmpty() && !m_xED_Mapping->get_text().isEmpty();
484}
485
487{
489 if( pE )
490 {
491 if (pE->m_aTerm != m_xED_Term->get_text())
492 return false;
493 if (pE->m_aMapping != m_xED_Mapping->get_text())
494 return false;
495 if (pE->m_nConversionPropertyType != m_xLB_Property->get_active() + 1)
496 return false;
497 return true;
498 }
499 return false;
500}
501
503{
504 if( m_xRB_To_Traditional->get_active() )
507}
508
510{
511 if( m_xRB_To_Traditional->get_active() )
514}
515
517{
518 if( m_xRB_To_Traditional->get_active() )
521}
522
524{
525 if( m_xRB_To_Traditional->get_active() )
528}
529
531{
532 bool bAdd = isEditFieldsHaveContent() && !getActiveDictionary().hasTerm(m_xED_Term->get_text());
533 m_xPB_Add->set_sensitive( bAdd );
534
535 m_xPB_Delete->set_sensitive(!bAdd && getActiveDictionary().get_selected_index() != -1);
536
537 bool bModify = false;
538 {
540 bModify = !bAdd && pFirstSelectedEntry && pFirstSelectedEntry->m_aTerm == m_xED_Term->get_text();
542 bModify = false;
543 }
544 m_xPB_Modify->set_sensitive( bModify );
545}
546
548{
549 if( !isEditFieldsHaveContent() )
550 return;
551
552 sal_Int16 nConversionPropertyType = m_xLB_Property->get_active() + 1;
553
554 getActiveDictionary().addEntry( m_xED_Term->get_text(), m_xED_Mapping->get_text(), nConversionPropertyType );
555
556 if( m_xCB_Reverse->get_active() )
557 {
558 getReverseDictionary().deleteEntries( m_xED_Mapping->get_text() );
559 getReverseDictionary().addEntry( m_xED_Mapping->get_text(), m_xED_Term->get_text(), nConversionPropertyType );
560 }
561
562 updateButtons();
563}
564
566{
567 OUString aTerm( m_xED_Term->get_text() );
568 OUString aMapping( m_xED_Mapping->get_text() );
569 sal_Int16 nConversionPropertyType = m_xLB_Property->get_active() + 1;
570
571 DictionaryList& rActive = getActiveDictionary();
572 DictionaryList& rReverse = getReverseDictionary();
573
575 if( pE && pE->m_aTerm != aTerm )
576 return;
577
578 if( pE )
579 {
580 if( pE->m_aMapping != aMapping || pE->m_nConversionPropertyType != nConversionPropertyType )
581 {
582 if( m_xCB_Reverse->get_active() )
583 {
584 rReverse.deleteEntries( pE->m_aMapping );
585 int nPos = rReverse.deleteEntries( aMapping );
586 rReverse.addEntry( aMapping, aTerm, nConversionPropertyType, nPos );
587 }
588
589 int nPos = rActive.deleteEntries( aTerm );
590 rActive.addEntry( aTerm, aMapping, nConversionPropertyType, nPos );
591 }
592 }
593
594 updateButtons();
595}
596
598{
599 DictionaryList& rActive = getActiveDictionary();
600 DictionaryList& rReverse = getReverseDictionary();
601
602 int nEntry = rActive.get_selected_index();
603 if (nEntry != -1)
604 {
605 DictionaryEntry* pEntry = rActive.getEntryOnPos(nEntry);
606 if (pEntry)
607 {
608 OUString aMapping = pEntry->m_aMapping;
609 rActive.deleteEntryOnPos(nEntry);
610 if (m_xCB_Reverse->get_active())
611 rReverse.deleteEntries(aMapping);
612 }
613 }
614
615 updateButtons();
616}
617
619{
620 sal_Int32 nTextConversionOptions = m_nTextConversionOptions;
621 if(m_nTextConversionOptions & i18n::TextConversionOption::USE_CHARACTER_VARIANTS )
622 nTextConversionOptions = nTextConversionOptions^i18n::TextConversionOption::USE_CHARACTER_VARIANTS ;
623
624 m_xCT_DictionaryToSimplified->refillFromDictionary( nTextConversionOptions );
626
627 short nRet = GenericDialogController::run();
628
629 if( nRet == RET_OK )
630 {
631 //save settings to configuration
632 SvtLinguConfig aLngCfg;
633 aLngCfg.SetProperty( UPN_IS_REVERSE_MAPPING, uno::Any(m_xCB_Reverse->get_active()) );
634
637 }
638
639 m_xCT_DictionaryToSimplified->deleteAll();
641
642 return nRet;
643}
644
646{
647 bool bSortAtoZ = rList.get_sort_order();
648
649 //set new arrow positions in headerbar
650 if (nColumn == rList.get_sort_column())
651 {
652 bSortAtoZ = !bSortAtoZ;
653 rList.set_sort_order(bSortAtoZ);
654 }
655 else
656 {
658 rList.set_sort_column(nColumn);
659 }
660
661 //sort lists
662 rList.set_sort_indicator(bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, nColumn);
663}
664
665IMPL_LINK(ChineseDictionaryDialog, ToSimplifiedHeaderBarClick, int, nColumn, void)
666{
667 HeaderBarClick(*m_xCT_DictionaryToSimplified, nColumn);
668}
669
670IMPL_LINK(ChineseDictionaryDialog, ToTraditionalHeaderBarClick, int, nColumn, void)
671{
672 HeaderBarClick(*m_xCT_DictionaryToTraditional, nColumn);
673}
674
675} //end namespace
676
677/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr tools::Long Width() const
css::uno::Any GetProperty(std::u16string_view rPropertyName) const
bool SetProperty(std::u16string_view rPropertyName, const css::uno::Any &rValue)
std::unique_ptr< weld::RadioButton > m_xRB_To_Traditional
std::unique_ptr< DictionaryList > m_xCT_DictionaryToSimplified
std::unique_ptr< DictionaryList > m_xCT_DictionaryToTraditional
std::unique_ptr< weld::CheckButton > m_xCB_Reverse
css::uno::Reference< css::uno::XComponentContext > m_xContext
std::unique_ptr< weld::RadioButton > m_xRB_To_Simplified
void initDictionaryControl(DictionaryList *pList, const css::uno::Reference< css::linguistic2::XConversionDictionary > &xDictionary)
void setDirectionAndTextConversionOptions(bool bDirectionToSimplified, sal_Int32 nTextConversionOptions)
static void HeaderBarClick(DictionaryList &rList, int nColumn)
void addEntry(const OUString &rTerm, const OUString &rMapping, sal_Int16 nConversionPropertyType, int nPos=-1)
int deleteEntries(std::u16string_view rTerm)
DictionaryList(std::unique_ptr< weld::TreeView > xTreeView)
DictionaryEntry * getTermEntry(std::u16string_view rTerm) const
void set_sort_indicator(TriState eState, int nColumn)
void refillFromDictionary(sal_Int32 nTextConversionOptions)
DictionaryEntry * getEntryOnPos(sal_Int32 nPos) const
void init(const css::uno::Reference< css::linguistic2::XConversionDictionary > &xDictionary, weld::Entry *pED_Term, weld::Entry *pED_Mapping, weld::ComboBox *pLB_Property)
OUString getPropertyTypeName(sal_Int16 nConversionPropertyType) const
bool hasTerm(std::u16string_view rTerm) const
css::uno::Reference< css::linguistic2::XConversionDictionary > m_xDictionary
std::unique_ptr< weld::TreeView > m_xControl
std::vector< DictionaryEntry * > m_aToBeDeleted
std::unique_ptr< weld::TreeIter > m_xIter
virtual OUString get_text(int pos) const=0
virtual int get_count() const=0
virtual Size get_preferred_size() const=0
FormulaCommand pE
float y
TRISTATE_FALSE
TRISTATE_INDET
TRISTATE_TRUE
constexpr OUStringLiteral UPN_IS_REVERSE_MAPPING
sal_uInt16 nPos
NONE
IMPL_LINK(ChineseDictionaryDialog, ToSimplifiedHeaderBarClick, int, nColumn, void)
IMPL_LINK_NOARG(ChineseDictionaryDialog, SizeAllocHdl, const Size &, void)
OUString toId(const void *pValue)
DictionaryEntry(OUString rTerm, OUString aMapping, sal_Int16 nConversionPropertyType, bool bNewEntry=false)
RET_OK
Reference< XControl > m_xControl