summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Meies <fme@openoffice.org>2002-08-02 08:58:02 +0000
committerFrank Meies <fme@openoffice.org>2002-08-02 08:58:02 +0000
commitcb387b1d0b4395a065a51d9eac10df983106bd38 (patch)
tree86e7f6431b1fb0e2fd5c9358987127db078afbf3
parent00e8eba862df67e843a0c050d25240f9523ac903 (diff)
#100447# Consider different scripts for similarity search
-rw-r--r--unotools/inc/unotools/textsearch.hxx7
-rw-r--r--unotools/source/i18n/textsearch.cxx26
2 files changed, 29 insertions, 4 deletions
diff --git a/unotools/inc/unotools/textsearch.hxx b/unotools/inc/unotools/textsearch.hxx
index a8876d366c9d..e071a5cbea5d 100644
--- a/unotools/inc/unotools/textsearch.hxx
+++ b/unotools/inc/unotools/textsearch.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: textsearch.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jp $ $Date: 2001-02-01 20:29:36 $
+ * last change: $Author: fme $ $Date: 2002-08-02 09:57:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -207,6 +207,9 @@ public:
int SearchBkwrd( const String &rStr,
xub_StrLen* pStart, xub_StrLen* pEnde,
::com::sun::star::util::SearchResult* pSrchResult = 0 );
+
+ void SetLocale( const ::com::sun::star::util::SearchOptions& rOpt,
+ const ::com::sun::star::lang::Locale& rLocale );
};
// ............................................................................
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index 1462abc68d09..f5429159dd2c 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: textsearch.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: er $ $Date: 2001-07-17 14:25:12 $
+ * last change: $Author: fme $ $Date: 2002-08-02 09:58:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -231,6 +231,28 @@ void TextSearch::Init( const SearchParam & rParam,
}
}
+void TextSearch::SetLocale( const ::com::sun::star::util::SearchOptions& rOptions,
+ const ::com::sun::star::lang::Locale& rLocale )
+{
+ // convert SearchParam to the UNO SearchOptions
+ SearchOptions aSOpt( rOptions );
+ aSOpt.Locale = rLocale;
+
+ try
+ {
+ Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ xTextSearch = Reference< XTextSearch > ( xMSF->createInstance(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.util.TextSearch" ) ) ), UNO_QUERY );
+ xTextSearch->setOptions( aSOpt );
+ }
+ catch ( Exception& )
+ {
+ DBG_ERRORFILE( "TextSearch ctor: Exception caught!" );
+ }
+}
+
+
TextSearch::~TextSearch()
{
}