Line data Source code
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 : #include "thesdlg.hxx"
21 : #include "thesdlg_impl.hxx"
22 : #include "cuires.hrc"
23 : #include "dialmgr.hxx"
24 :
25 : #include <tools/shl.hxx>
26 : #include <svl/lngmisc.hxx>
27 : #include <vcl/graphicfilter.hxx>
28 : #include <svtools/svlbitm.hxx>
29 : #include <svtools/treelistbox.hxx>
30 : #include "svtools/treelistentry.hxx"
31 : #include "svtools/viewdataentry.hxx"
32 : #include <vcl/wrkwin.hxx>
33 : #include <vcl/msgbox.hxx>
34 : #include <vcl/svapp.hxx>
35 : #include <thesdlg.hxx>
36 : #include <svx/dlgutil.hxx>
37 : #include <svx/dialmgr.hxx>
38 : #include <svx/svxerr.hxx>
39 : #include <editeng/unolingu.hxx>
40 : #include <svx/langbox.hxx>
41 : #include <svtools/langtab.hxx>
42 : #include <unotools/lingucfg.hxx>
43 : #include <i18nlangtag/mslangid.hxx>
44 : #include <comphelper/processfactory.hxx>
45 : #include <comphelper/string.hxx>
46 : #include <osl/file.hxx>
47 :
48 : #include <stack>
49 : #include <algorithm>
50 :
51 : #include <com/sun/star/linguistic2/XThesaurus.hpp>
52 : #include <com/sun/star/linguistic2/XMeaning.hpp>
53 : #include <com/sun/star/linguistic2/LinguServiceManager.hpp>
54 :
55 : using namespace ::com::sun::star;
56 :
57 : // class LookUpComboBox --------------------------------------------------
58 :
59 0 : LookUpComboBox::LookUpComboBox(Window *pParent)
60 0 : : ComboBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP)
61 : {
62 0 : EnableAutoSize(true);
63 :
64 0 : m_aModifyTimer.SetTimeoutHdl( LINK( this, LookUpComboBox, ModifyTimer_Hdl ) );
65 0 : m_aModifyTimer.SetTimeout( 500 );
66 :
67 0 : EnableAutocomplete( sal_False );
68 0 : }
69 :
70 0 : extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeLookUpComboBox(Window *pParent, VclBuilder::stringmap &)
71 : {
72 0 : return new LookUpComboBox(pParent);
73 : }
74 :
75 0 : void LookUpComboBox::init(SvxThesaurusDialog *pDialog)
76 : {
77 0 : m_pDialog = pDialog;
78 0 : }
79 :
80 0 : LookUpComboBox::~LookUpComboBox()
81 : {
82 0 : }
83 :
84 0 : void LookUpComboBox::Modify()
85 : {
86 0 : m_aModifyTimer.Start();
87 0 : }
88 :
89 0 : IMPL_LINK( LookUpComboBox, ModifyTimer_Hdl, Timer *, EMPTYARG /*pTimer*/ )
90 : {
91 0 : m_pDialog->LookUp( GetText() );
92 0 : m_aModifyTimer.Stop();
93 0 : return 0;
94 : }
95 :
96 : // class ReplaceEdit --------------------------------------------------
97 :
98 0 : ReplaceEdit::ReplaceEdit(Window *pParent)
99 0 : : Edit(pParent, WB_BORDER | WB_TABSTOP)
100 : {
101 0 : }
102 :
103 0 : extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeReplaceEdit(Window *pParent, VclBuilder::stringmap &)
104 : {
105 0 : return new ReplaceEdit(pParent);
106 : }
107 :
108 0 : ReplaceEdit::~ReplaceEdit()
109 : {
110 0 : }
111 :
112 0 : void ReplaceEdit::Modify()
113 : {
114 0 : if (m_pBtn)
115 0 : m_pBtn->Enable( !GetText().isEmpty() );
116 0 : }
117 :
118 0 : void ReplaceEdit::SetText( const OUString& rStr )
119 : {
120 0 : Edit::SetText( rStr );
121 0 : Modify();
122 0 : }
123 :
124 0 : void ReplaceEdit::SetText( const OUString& rStr, const Selection& rNewSelection )
125 : {
126 0 : Edit::SetText( rStr, rNewSelection );
127 0 : Modify();
128 0 : }
129 :
130 : // class ThesaurusAlternativesCtrl ----------------------------------
131 :
132 0 : AlternativesString::AlternativesString(
133 : ThesaurusAlternativesCtrl &rControl,
134 : SvTreeListEntry* pEntry, sal_uInt16 nFlags, const String& rStr ) :
135 :
136 : SvLBoxString( pEntry, nFlags, rStr ),
137 0 : m_rControlImpl( rControl )
138 : {
139 0 : }
140 :
141 0 : void AlternativesString::Paint(
142 : const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/,
143 : const SvTreeListEntry* pEntry)
144 : {
145 0 : AlternativesExtraData* pData = m_rControlImpl.GetExtraData( pEntry );
146 0 : Point aPos( rPos );
147 0 : Font aOldFont( rDev.GetFont());
148 0 : if (pData && pData->IsHeader())
149 : {
150 0 : Font aFont( aOldFont );
151 0 : aFont.SetWeight( WEIGHT_BOLD );
152 0 : rDev.SetFont( aFont );
153 0 : aPos.X() = 0;
154 : }
155 : else
156 0 : aPos.X() += 5;
157 0 : rDev.DrawText( aPos, GetText() );
158 0 : rDev.SetFont( aOldFont );
159 0 : }
160 :
161 0 : ThesaurusAlternativesCtrl::ThesaurusAlternativesCtrl(Window* pParent)
162 0 : : SvxCheckListBox(pParent)
163 : {
164 0 : SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE );
165 0 : SetHighlightRange();
166 0 : }
167 :
168 0 : extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeThesaurusAlternativesCtrl(Window *pParent, VclBuilder::stringmap &)
169 : {
170 0 : return new ThesaurusAlternativesCtrl(pParent);
171 : }
172 :
173 0 : void ThesaurusAlternativesCtrl::init(SvxThesaurusDialog *pDialog)
174 : {
175 0 : m_pDialog = pDialog;
176 0 : }
177 :
178 0 : ThesaurusAlternativesCtrl::~ThesaurusAlternativesCtrl()
179 : {
180 0 : ClearExtraData();
181 0 : }
182 :
183 0 : void ThesaurusAlternativesCtrl::ClearExtraData()
184 : {
185 0 : UserDataMap_t aEmpty;
186 0 : m_aUserData.swap( aEmpty );
187 0 : }
188 :
189 0 : void ThesaurusAlternativesCtrl::SetExtraData(
190 : const SvTreeListEntry *pEntry,
191 : const AlternativesExtraData &rData )
192 : {
193 0 : if (!pEntry)
194 0 : return;
195 :
196 0 : UserDataMap_t::iterator aIt( m_aUserData.find( pEntry ) );
197 0 : if (aIt != m_aUserData.end())
198 0 : aIt->second = rData;
199 : else
200 0 : m_aUserData[ pEntry ] = rData;
201 : }
202 :
203 0 : AlternativesExtraData * ThesaurusAlternativesCtrl::GetExtraData(
204 : const SvTreeListEntry *pEntry )
205 : {
206 0 : AlternativesExtraData *pRes = NULL;
207 0 : UserDataMap_t::iterator aIt( m_aUserData.find( pEntry ) );
208 0 : if (aIt != m_aUserData.end())
209 0 : pRes = &aIt->second;
210 0 : return pRes;
211 : }
212 :
213 0 : SvTreeListEntry * ThesaurusAlternativesCtrl::AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader )
214 : {
215 0 : SvTreeListEntry* pEntry = new SvTreeListEntry;
216 0 : OUString aText;
217 0 : if (bIsHeader && nVal >= 0)
218 : {
219 0 : aText = OUString::number( nVal ) + ". ";
220 : }
221 0 : pEntry->AddItem( new SvLBoxString( pEntry, 0, String() ) ); // add empty column
222 0 : aText += rText;
223 0 : pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0 ) ); // otherwise crash
224 0 : pEntry->AddItem( new AlternativesString( *this, pEntry, 0, aText ) );
225 :
226 0 : SetExtraData( pEntry, AlternativesExtraData( rText, bIsHeader ) );
227 0 : GetModel()->Insert( pEntry );
228 :
229 0 : if (bIsHeader)
230 0 : GetViewDataEntry( pEntry )->SetSelectable( false );
231 :
232 0 : return pEntry;
233 : }
234 :
235 0 : void ThesaurusAlternativesCtrl::KeyInput( const KeyEvent& rKEvt )
236 : {
237 0 : const KeyCode& rKey = rKEvt.GetKeyCode();
238 :
239 0 : if (rKey.GetCode() == KEY_RETURN || rKey.GetCode() == KEY_ESCAPE)
240 0 : GetParent()->KeyInput( rKEvt ); // parent will close dialog...
241 0 : else if (rKey.GetCode() == KEY_SPACE)
242 0 : m_pDialog->AlternativesDoubleClickHdl_Impl( this ); // look up current selected entry
243 0 : else if (GetEntryCount())
244 0 : SvxCheckListBox::KeyInput( rKEvt );
245 0 : }
246 :
247 0 : void ThesaurusAlternativesCtrl::Paint( const Rectangle& rRect )
248 : {
249 0 : if (!m_pDialog->WordFound())
250 : {
251 0 : Size aTextSize( GetTextWidth( m_pDialog->getErrStr() ), GetTextHeight() );
252 0 : aTextSize = LogicToPixel( aTextSize );
253 0 : Point aPos;
254 0 : aPos.X() += GetSizePixel().Width() / 2 - aTextSize.Width() / 2;
255 0 : aPos.Y() += GetSizePixel().Height() / 2;
256 0 : aPos = PixelToLogic( aPos );
257 0 : DrawText( aPos, m_pDialog->getErrStr() );
258 :
259 : }
260 : else
261 0 : SvxCheckListBox::Paint( rRect );
262 0 : }
263 :
264 0 : uno::Sequence< uno::Reference< linguistic2::XMeaning > > SvxThesaurusDialog::queryMeanings_Impl(
265 : OUString& rTerm,
266 : const lang::Locale& rLocale,
267 : const beans::PropertyValues& rProperties )
268 : throw(lang::IllegalArgumentException, uno::RuntimeException)
269 : {
270 : uno::Sequence< uno::Reference< linguistic2::XMeaning > > aMeanings(
271 0 : xThesaurus->queryMeanings( rTerm, rLocale, rProperties ) );
272 :
273 : // text with '.' at the end?
274 0 : if ( 0 == aMeanings.getLength() && !rTerm.isEmpty() &&
275 0 : rTerm.getStr()[ rTerm.getLength() - 1 ] == '.')
276 : {
277 : // try again without trailing '.' chars. It may be a word at the
278 : // end of a sentence and not an abbreviation...
279 0 : String aTxt(comphelper::string::stripEnd(rTerm, '.'));
280 0 : aMeanings = xThesaurus->queryMeanings( aTxt, rLocale, rProperties );
281 0 : if (aMeanings.getLength())
282 : {
283 0 : rTerm = aTxt;
284 0 : }
285 : }
286 :
287 0 : return aMeanings;
288 : }
289 :
290 0 : bool SvxThesaurusDialog::UpdateAlternativesBox_Impl()
291 : {
292 0 : lang::Locale aLocale( LanguageTag( nLookUpLanguage ).getLocale() );
293 : uno::Sequence< uno::Reference< linguistic2::XMeaning > > aMeanings = queryMeanings_Impl(
294 0 : aLookUpText, aLocale, uno::Sequence< beans::PropertyValue >() );
295 0 : const sal_Int32 nMeanings = aMeanings.getLength();
296 0 : const uno::Reference< linguistic2::XMeaning > *pMeanings = aMeanings.getConstArray();
297 :
298 0 : m_pAlternativesCT->SetUpdateMode( sal_False );
299 :
300 : // clear old user data of control before creating new ones via AddEntry below
301 0 : m_pAlternativesCT->ClearExtraData();
302 :
303 0 : m_pAlternativesCT->Clear();
304 0 : for (sal_Int32 i = 0; i < nMeanings; ++i)
305 : {
306 0 : OUString rMeaningTxt = pMeanings[i]->getMeaning();
307 0 : uno::Sequence< OUString > aSynonyms( pMeanings[i]->querySynonyms() );
308 0 : const sal_Int32 nSynonyms = aSynonyms.getLength();
309 0 : const OUString *pSynonyms = aSynonyms.getConstArray();
310 : DBG_ASSERT( !rMeaningTxt.isEmpty(), "meaning with empty text" );
311 : DBG_ASSERT( nSynonyms > 0, "meaning without synonym" );
312 :
313 0 : m_pAlternativesCT->AddEntry( i + 1, rMeaningTxt, true );
314 0 : for (sal_Int32 k = 0; k < nSynonyms; ++k)
315 0 : m_pAlternativesCT->AddEntry( -1, pSynonyms[k], false );
316 0 : }
317 :
318 0 : m_pAlternativesCT->SetUpdateMode( sal_True );
319 :
320 0 : return nMeanings > 0;
321 : }
322 :
323 0 : void SvxThesaurusDialog::LookUp( const String &rText )
324 : {
325 0 : if (OUString(rText) != m_pWordCB->GetText()) // avoid moving of the cursor if the text is the same
326 0 : m_pWordCB->SetText( rText );
327 0 : LookUp_Impl();
328 0 : }
329 :
330 0 : IMPL_LINK( SvxThesaurusDialog, LeftBtnHdl_Impl, Button *, pBtn )
331 : {
332 0 : if (pBtn && aLookUpHistory.size() >= 2)
333 : {
334 0 : aLookUpHistory.pop(); // remove current look up word from stack
335 0 : m_pWordCB->SetText( aLookUpHistory.top() ); // retrieve previous look up word
336 0 : aLookUpHistory.pop();
337 0 : LookUp_Impl();
338 : }
339 0 : return 0;
340 : }
341 :
342 0 : IMPL_LINK( SvxThesaurusDialog, LanguageHdl_Impl, ListBox*, pLB )
343 : {
344 0 : String aLangText( pLB->GetSelectEntry() );
345 0 : LanguageType nLang = SvtLanguageTable().GetType( aLangText );
346 : DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" );
347 0 : if (xThesaurus->hasLocale( LanguageTag( nLang ).getLocale() ))
348 0 : nLookUpLanguage = nLang;
349 0 : SetWindowTitle( nLang );
350 0 : LookUp_Impl();
351 0 : return 0;
352 : }
353 :
354 0 : void SvxThesaurusDialog::LookUp_Impl()
355 : {
356 0 : String aText( m_pWordCB->GetText() );
357 :
358 0 : aLookUpText = OUString( aText );
359 0 : if (!aLookUpText.isEmpty() &&
360 0 : (aLookUpHistory.empty() || aLookUpText != aLookUpHistory.top()))
361 0 : aLookUpHistory.push( aLookUpText );
362 :
363 0 : m_bWordFound = UpdateAlternativesBox_Impl();
364 0 : m_pAlternativesCT->Enable( m_bWordFound );
365 :
366 0 : if ( m_pWordCB->GetEntryPos( aText ) == LISTBOX_ENTRY_NOTFOUND )
367 0 : m_pWordCB->InsertEntry( aText );
368 :
369 0 : m_pReplaceEdit->SetText( String() );
370 0 : m_pLeftBtn->Enable( aLookUpHistory.size() > 1 );
371 0 : }
372 :
373 0 : IMPL_LINK( SvxThesaurusDialog, WordSelectHdl_Impl, ComboBox *, pBox )
374 : {
375 0 : if (pBox && !m_pWordCB->IsTravelSelect()) // act only upon return key and not when traveling with cursor keys
376 : {
377 0 : sal_uInt16 nPos = pBox->GetSelectEntryPos();
378 0 : String aStr( pBox->GetEntry( nPos ) );
379 0 : aStr = linguistic::GetThesaurusReplaceText( aStr );
380 0 : m_pWordCB->SetText( aStr );
381 0 : LookUp_Impl();
382 : }
383 :
384 0 : return 0;
385 : }
386 :
387 0 : IMPL_LINK( SvxThesaurusDialog, AlternativesSelectHdl_Impl, SvxCheckListBox *, pBox )
388 : {
389 0 : SvTreeListEntry *pEntry = pBox ? pBox->GetCurEntry() : NULL;
390 0 : if (pEntry)
391 : {
392 0 : AlternativesExtraData * pData = m_pAlternativesCT->GetExtraData( pEntry );
393 0 : String aStr;
394 0 : if (pData && !pData->IsHeader())
395 : {
396 0 : aStr = pData->GetText();
397 0 : aStr = linguistic::GetThesaurusReplaceText( aStr );
398 : }
399 0 : m_pReplaceEdit->SetText( aStr );
400 : }
401 0 : return 0;
402 : }
403 :
404 0 : IMPL_LINK( SvxThesaurusDialog, AlternativesDoubleClickHdl_Impl, SvxCheckListBox *, pBox )
405 : {
406 0 : SvTreeListEntry *pEntry = pBox ? pBox->GetCurEntry() : NULL;
407 0 : if (pEntry)
408 : {
409 0 : AlternativesExtraData * pData = m_pAlternativesCT->GetExtraData( pEntry );
410 0 : String aStr;
411 0 : if (pData && !pData->IsHeader())
412 : {
413 0 : aStr = pData->GetText();
414 0 : aStr = linguistic::GetThesaurusReplaceText( aStr );
415 : }
416 :
417 0 : m_pWordCB->SetText( aStr );
418 0 : if (aStr.Len() > 0)
419 0 : LookUp_Impl();
420 : }
421 :
422 : //! workaround to set the selection since calling SelectEntryPos within
423 : //! the double click handler does not work
424 0 : Application::PostUserEvent( STATIC_LINK( this, SvxThesaurusDialog, SelectFirstHdl_Impl ), pBox );
425 0 : return 0;
426 : }
427 :
428 0 : IMPL_STATIC_LINK( SvxThesaurusDialog, SelectFirstHdl_Impl, SvxCheckListBox *, pBox )
429 : {
430 : (void) pThis;
431 0 : if (pBox && pBox->GetEntryCount() >= 2)
432 0 : pBox->SelectEntryPos( 1 ); // pos 0 is a 'header' that is not selectable
433 0 : return 0;
434 : }
435 :
436 : // class SvxThesaurusDialog ----------------------------------------------
437 :
438 0 : SvxThesaurusDialog::SvxThesaurusDialog(
439 : Window* pParent,
440 : uno::Reference< linguistic2::XThesaurus > xThes,
441 : const String &rWord,
442 : LanguageType nLanguage)
443 : : SvxStandardDialog(pParent, "ThesaurusDialog", "cui/ui/thesaurus.ui")
444 0 : , m_aErrStr(CUI_RESSTR(RID_SVXSTR_ERR_TEXTNOTFOUND))
445 : , xThesaurus(NULL)
446 : , aLookUpText()
447 : , nLookUpLanguage(LANGUAGE_NONE)
448 0 : , m_bWordFound(false)
449 : {
450 0 : get(m_pLeftBtn, "left");
451 :
452 0 : get(m_pWordCB, "wordcb");
453 0 : m_pWordCB->init(this);
454 :
455 0 : get(m_pAlternativesCT, "alternatives");
456 0 : m_pAlternativesCT->init(this);
457 :
458 0 : get(m_pReplaceEdit, "replaceed");
459 0 : PushButton *pReplaceBtn = get<PushButton>("replace");
460 0 : m_pReplaceEdit->init(pReplaceBtn);
461 :
462 0 : get(m_pLangLB, "langcb");
463 :
464 0 : pReplaceBtn->SetClickHdl( LINK( this, SvxThesaurusDialog, ReplaceBtnHdl_Impl ) );
465 0 : m_pLeftBtn->SetClickHdl( LINK( this, SvxThesaurusDialog, LeftBtnHdl_Impl ) );
466 0 : m_pWordCB->SetSelectHdl( LINK( this, SvxThesaurusDialog, WordSelectHdl_Impl ) );
467 0 : m_pLangLB->SetSelectHdl( LINK( this, SvxThesaurusDialog, LanguageHdl_Impl ) );
468 0 : m_pAlternativesCT->SetSelectHdl( LINK( this, SvxThesaurusDialog, AlternativesSelectHdl_Impl ));
469 0 : m_pAlternativesCT->SetDoubleClickHdl( LINK( this, SvxThesaurusDialog, AlternativesDoubleClickHdl_Impl ));
470 :
471 0 : xThesaurus = xThes;
472 0 : aLookUpText = OUString( rWord );
473 0 : nLookUpLanguage = nLanguage;
474 0 : if (rWord.Len() > 0)
475 0 : aLookUpHistory.push( rWord );
476 :
477 0 : OUString aTmp( rWord );
478 0 : linguistic::RemoveHyphens( aTmp );
479 0 : linguistic::ReplaceControlChars( aTmp );
480 0 : String aTmp2( aTmp );
481 0 : m_pReplaceEdit->SetText( aTmp2 );
482 0 : m_pWordCB->InsertEntry( aTmp2 );
483 :
484 0 : LookUp( aTmp2 );
485 0 : m_pAlternativesCT->GrabFocus();
486 0 : m_pLeftBtn->Enable( sal_False );
487 :
488 : // fill language menu button list
489 0 : SvtLanguageTable aLangTab;
490 0 : uno::Sequence< lang::Locale > aLocales;
491 0 : if (xThesaurus.is())
492 0 : aLocales = xThesaurus->getLocales();
493 0 : const sal_Int32 nLocales = aLocales.getLength();
494 0 : const lang::Locale *pLocales = aLocales.getConstArray();
495 0 : m_pLangLB->Clear();
496 0 : std::vector< OUString > aLangVec;
497 0 : for (sal_Int32 i = 0; i < nLocales; ++i)
498 : {
499 0 : const LanguageType nLang = LanguageTag( pLocales[i] ).getLanguageType();
500 : DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" );
501 0 : aLangVec.push_back( aLangTab.GetString( nLang ) );
502 : }
503 0 : std::sort( aLangVec.begin(), aLangVec.end() );
504 0 : for (size_t i = 0; i < aLangVec.size(); ++i)
505 0 : m_pLangLB->InsertEntry( aLangVec[i] );
506 :
507 0 : std::vector< OUString >::iterator aI = std::find(aLangVec.begin(), aLangVec.end(), aLangTab.GetString(nLanguage));
508 0 : if (aI != aLangVec.end())
509 : {
510 0 : m_pLangLB->SelectEntry(*aI);
511 : }
512 :
513 0 : SetWindowTitle(nLanguage);
514 :
515 : // disable controls if service is missing
516 0 : if (!xThesaurus.is())
517 0 : Enable( sal_False );
518 0 : }
519 :
520 0 : IMPL_LINK( SvxThesaurusDialog, ReplaceBtnHdl_Impl, Button *, EMPTYARG /*pBtn*/ )
521 : {
522 0 : EndDialog(true);
523 0 : return 0;
524 : }
525 :
526 0 : SvxThesaurusDialog::~SvxThesaurusDialog()
527 : {
528 0 : }
529 :
530 0 : void SvxThesaurusDialog::SetWindowTitle( LanguageType nLanguage )
531 : {
532 : // adjust language
533 0 : String aStr( GetText() );
534 0 : aStr.Erase( aStr.Search( sal_Unicode( '(' ) ) - 1 );
535 0 : aStr.Append( OUString(" (") );
536 0 : aStr += SvtLanguageTable().GetLanguageString( nLanguage );
537 0 : aStr.Append( sal_Unicode( ')' ) );
538 0 : SetText( aStr ); // set window title
539 0 : }
540 :
541 0 : String SvxThesaurusDialog::GetWord()
542 : {
543 0 : return m_pReplaceEdit->GetText();
544 : }
545 :
546 0 : sal_uInt16 SvxThesaurusDialog::GetLanguage() const
547 : {
548 0 : return nLookUpLanguage;
549 : }
550 :
551 0 : void SvxThesaurusDialog::Apply()
552 : {
553 0 : }
554 :
555 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|