summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorThomas Lange [tl] <tl@openoffice.org>2010-07-26 13:11:26 +0200
committerThomas Lange [tl] <tl@openoffice.org>2010-07-26 13:11:26 +0200
commitcbe34bff4881d62a8026c96aa26723989490d508 (patch)
tree38388b9682ed3d83bd4603a96f39a3229aabec93 /cui
parentc7896e24ec34b87aba39e8b2ff19a21fe0c518a6 (diff)
cws tl82: #i106993# thesaurus code clean-up
Diffstat (limited to 'cui')
-rwxr-xr-xcui/source/dialogs/thesdlg.cxx37
1 files changed, 4 insertions, 33 deletions
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index bf617b126747..f6523676c306 100755
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -57,6 +57,7 @@
#include <i18npool/mslangid.hxx>
#include <comphelper/processfactory.hxx>
#include <osl/file.hxx>
+#include <svl/lngmisc.hxx>
#include <stack>
@@ -73,36 +74,6 @@ using ::rtl::OUString;
#define A2S(x) String::CreateFromAscii( x )
-
-// GetReplaceEditString -------------------------------
-
-static void GetReplaceEditString( String &rText )
-{
- // The strings returned by the thesaurus saometimes have some
- // explanation text put in between '(' and ')' or a trailing '*'.
- // These parts should not be put in the ReplaceEdit Text that may get
- // inserted into the document. Thus we strip them from the text.
-
- xub_StrLen nPos = rText.Search( sal_Unicode('(') );
- while (STRING_NOTFOUND != nPos)
- {
- xub_StrLen nEnd = rText.Search( sal_Unicode(')'), nPos );
- if (STRING_NOTFOUND != nEnd)
- rText.Erase( nPos, nEnd-nPos+1 );
- else
- break;
- nPos = rText.Search( sal_Unicode('(') );
- }
-
- nPos = rText.Search( sal_Unicode('*') );
- if (STRING_NOTFOUND != nPos)
- rText.Erase( nPos );
-
- // remove any possible remaining ' ' that may confuse the thesaurus
- // when it gets called with the text
- rText.EraseLeadingAndTrailingChars( sal_Unicode(' ') );
-}
-
// class LookUpComboBox_Impl --------------------------------------------------
LookUpComboBox_Impl::LookUpComboBox_Impl(
@@ -454,7 +425,7 @@ IMPL_LINK( SvxThesaurusDialog_Impl, WordSelectHdl_Impl, ComboBox *, pBox )
{
USHORT nPos = pBox->GetSelectEntryPos();
String aStr( pBox->GetEntry( nPos ) );
- GetReplaceEditString( aStr );
+ aStr = linguistic::GetThesaurusReplaceText( aStr );
aWordCB.SetText( aStr );
LookUp_Impl();
}
@@ -473,7 +444,7 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesSelectHdl_Impl, SvxCheckListBox
if (!pData->IsHeader())
{
aStr = pData->GetText();
- GetReplaceEditString( aStr );
+ aStr = linguistic::GetThesaurusReplaceText( aStr );
}
aReplaceEdit.SetText( aStr );
}
@@ -491,7 +462,7 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckLis
if (!pData->IsHeader())
{
aStr = pData->GetText();
- GetReplaceEditString( aStr );
+ aStr = linguistic::GetThesaurusReplaceText( aStr );
}
aWordCB.SetText( aStr );