1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include "unosrch.hxx"
25 #include <unobaseclass.hxx>
28 #include <osl/mutex.hxx>
29 #include <vcl/svapp.hxx>
30 #include "editeng/unolingu.hxx"
31 #include <com/sun/star/util/SearchOptions.hpp>
32 #include <com/sun/star/util/SearchFlags.hpp>
33 #include <com/sun/star/i18n/TransliterationModules.hpp>
34 #include <com/sun/star/beans/PropertyAttribute.hpp>
35 #include <comphelper/servicehelper.hxx>
36 #include <cppuhelper/supportsservice.hxx>
38 using namespace ::com::sun::star
;
40 class SwSearchProperties_Impl
42 beans::PropertyValue
** pValueArr
; //
44 const PropertyEntryVector_t aPropertyEntries
;
46 SwSearchProperties_Impl();
47 ~SwSearchProperties_Impl();
49 void SetProperties(const uno::Sequence
< beans::PropertyValue
>& aSearchAttribs
)
50 throw( beans::UnknownPropertyException
, lang::IllegalArgumentException
, uno::RuntimeException
);
51 const uno::Sequence
< beans::PropertyValue
> GetProperties() const;
53 void FillItemSet(SfxItemSet
& rSet
, sal_Bool bIsValueSearch
) const;
54 sal_Bool
HasAttributes() const;
57 SwSearchProperties_Impl::SwSearchProperties_Impl() :
59 aPropertyEntries( aSwMapProvider
.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR
)->getPropertyMap().getPropertyEntries())
61 nArrLen
= aPropertyEntries
.size();
62 pValueArr
= new beans::PropertyValue
*[nArrLen
];
63 for(sal_uInt32 i
= 0; i
< nArrLen
; i
++)
67 SwSearchProperties_Impl::~SwSearchProperties_Impl()
69 for(sal_uInt32 i
= 0; i
< nArrLen
; i
++)
74 void SwSearchProperties_Impl::SetProperties(const uno::Sequence
< beans::PropertyValue
>& aSearchAttribs
)
75 throw( beans::UnknownPropertyException
, lang::IllegalArgumentException
, uno::RuntimeException
)
77 const beans::PropertyValue
* pProps
= aSearchAttribs
.getConstArray();
80 //delete all existing values
81 for( i
= 0; i
< nArrLen
; i
++)
87 sal_uInt32 nLen
= aSearchAttribs
.getLength();
88 for(i
= 0; i
< nLen
; i
++)
90 sal_uInt16 nIndex
= 0;
91 PropertyEntryVector_t::const_iterator aIt
= aPropertyEntries
.begin();
92 while(pProps
[i
].Name
!= aIt
->sName
)
96 if( aIt
== aPropertyEntries
.end() )
97 throw beans::UnknownPropertyException();
99 pValueArr
[nIndex
] = new beans::PropertyValue(pProps
[i
]);
103 const uno::Sequence
< beans::PropertyValue
> SwSearchProperties_Impl::GetProperties() const
105 sal_uInt32 nPropCount
= 0;
107 for( i
= 0; i
< nArrLen
; i
++)
111 uno::Sequence
< beans::PropertyValue
> aRet(nPropCount
);
112 beans::PropertyValue
* pProps
= aRet
.getArray();
114 for(i
= 0; i
< nArrLen
; i
++)
118 pProps
[nPropCount
++] = *(pValueArr
[i
]);
124 void SwSearchProperties_Impl::FillItemSet(SfxItemSet
& rSet
, sal_Bool bIsValueSearch
) const
128 SfxPoolItem
* pBoxItem
= 0,
158 *pCrossedOutItem
= 0,
164 *pFontSizeCJKItem
= 0,
166 *pCJKPostureItem
= 0,
169 *pFontSizeCTLItem
= 0,
171 *pCTLPostureItem
= 0,
174 PropertyEntryVector_t::const_iterator aIt
= aPropertyEntries
.begin();
175 for(sal_uInt32 i
= 0; i
< nArrLen
; i
++, ++aIt
)
179 SfxPoolItem
* pTempItem
= 0;
184 pBoxItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
185 pTempItem
= pBoxItem
;
189 pBreakItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
190 pTempItem
= pBreakItem
;
192 case RES_CHRATR_AUTOKERN
:
194 pAutoKernItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
195 pTempItem
= pAutoKernItem
;
197 case RES_CHRATR_BACKGROUND
:
199 pBrushItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
200 pTempItem
= pBrushItem
;
202 case RES_CHRATR_CASEMAP
:
204 pCasemapItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
205 pTempItem
= pCasemapItem
;
207 case RES_CHRATR_COLOR
:
209 pCharColorItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
210 pTempItem
= pCharColorItem
;
212 case RES_CHRATR_CONTOUR
:
214 pContourItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
215 pTempItem
= pContourItem
;
217 case RES_CHRATR_CROSSEDOUT
:
219 pCrossedOutItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
220 pTempItem
= pCrossedOutItem
;
222 case RES_CHRATR_ESCAPEMENT
:
224 pEscItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
225 pTempItem
= pEscItem
;
227 case RES_CHRATR_BLINK
:
229 pBlinkItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
230 pTempItem
= pBlinkItem
;
232 case RES_CHRATR_FONT
:
234 pFontItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
235 pTempItem
= pFontItem
;
237 case RES_CHRATR_FONTSIZE
:
239 pFontSizeItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
240 pTempItem
= pFontSizeItem
;
242 case RES_CHRATR_KERNING
:
244 pKernItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
245 pTempItem
= pKernItem
;
247 case RES_CHRATR_LANGUAGE
:
249 pLangItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
250 pTempItem
= pLangItem
;
252 case RES_CHRATR_NOHYPHEN
:
254 pNHyphItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
255 pTempItem
= pNHyphItem
;
257 case RES_CHRATR_POSTURE
:
259 pPostItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
260 pTempItem
= pPostItem
;
262 case RES_CHRATR_SHADOWED
:
264 pShadItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
265 pTempItem
= pShadItem
;
267 case RES_TXTATR_CHARFMT
:
269 pCharFmtItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
270 pTempItem
= pCharFmtItem
;
272 case RES_CHRATR_UNDERLINE
:
274 pULineItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
275 pTempItem
= pULineItem
;
277 case RES_CHRATR_OVERLINE
:
279 pOLineItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
280 pTempItem
= pOLineItem
;
282 case RES_CHRATR_WEIGHT
:
284 pWeightItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
285 pTempItem
= pWeightItem
;
287 case RES_PARATR_DROP
:
289 pDropItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
290 pTempItem
= pDropItem
;
292 case RES_TXTATR_INETFMT
:
294 pInetItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
295 pTempItem
= pInetItem
;
299 pDescItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
300 pTempItem
= pDescItem
;
302 case RES_PARATR_ADJUST
:
304 pAdjItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
305 pTempItem
= pAdjItem
;
309 pBackItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
310 pTempItem
= pBackItem
;
314 pULItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
319 pLRItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
324 pKeepItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
325 pTempItem
= pKeepItem
;
329 pLineNumItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
330 pTempItem
= pLineNumItem
;
332 case RES_PARATR_LINESPACING
:
334 pLineSpaceItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
335 pTempItem
= pLineSpaceItem
;
337 case RES_PARATR_REGISTER
:
339 pRegItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
340 pTempItem
= pRegItem
;
342 case RES_PARATR_SPLIT
:
344 pSplitItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
345 pTempItem
= pSplitItem
;
347 case RES_PARATR_TABSTOP
:
349 pTabItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
350 pTempItem
= pTabItem
;
352 case RES_CHRATR_WORDLINEMODE
:
354 pWLineItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
355 pTempItem
= pWLineItem
;
357 case RES_CHRATR_CJK_FONT
:
359 pFontCJKItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
360 pTempItem
= pFontCJKItem
;
362 case RES_CHRATR_CJK_FONTSIZE
:
363 if(!pFontSizeCJKItem
)
364 pFontSizeCJKItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
365 pTempItem
= pFontSizeCJKItem
;
367 case RES_CHRATR_CJK_LANGUAGE
:
369 pCJKLangItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
370 pTempItem
= pCJKLangItem
;
372 case RES_CHRATR_CJK_POSTURE
:
373 if(!pCJKPostureItem
)
374 pCJKPostureItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
375 pTempItem
= pCJKPostureItem
;
377 case RES_CHRATR_CJK_WEIGHT
:
379 pCJKWeightItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
380 pTempItem
= pCJKWeightItem
;
382 case RES_CHRATR_CTL_FONT
:
384 pFontCTLItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
385 pTempItem
= pFontCTLItem
;
387 case RES_CHRATR_CTL_FONTSIZE
:
388 if(!pFontSizeCTLItem
)
389 pFontSizeCTLItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
390 pTempItem
= pFontSizeCTLItem
;
392 case RES_CHRATR_CTL_LANGUAGE
:
394 pCTLLangItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
395 pTempItem
= pCTLLangItem
;
397 case RES_CHRATR_CTL_POSTURE
:
398 if(!pCTLPostureItem
)
399 pCTLPostureItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
400 pTempItem
= pCTLPostureItem
;
402 case RES_CHRATR_CTL_WEIGHT
:
404 pCTLWeightItem
= rSet
.GetPool()->GetDefaultItem(aIt
->nWID
).Clone();
405 pTempItem
= pCTLWeightItem
;
412 pTempItem
->PutValue(pValueArr
[i
]->Value
, aIt
->nMemberId
);
413 rSet
.Put(*pTempItem
);
416 rSet
.InvalidateItem( pTempItem
->Which() );
422 delete pAutoKernItem
;
427 delete pLineSpaceItem
;
428 delete pLineNumItem
;
440 delete pCharFmtItem
;
446 delete pFontSizeItem
;
450 delete pCrossedOutItem
;
451 delete pContourItem
;
452 delete pCharColorItem
;
453 delete pCasemapItem
;
457 sal_Bool
SwSearchProperties_Impl::HasAttributes() const
459 for(sal_uInt32 i
= 0; i
< nArrLen
; i
++)
465 SwXTextSearch::SwXTextSearch() :
466 pSearchProperties( new SwSearchProperties_Impl
),
467 pReplaceProperties( new SwSearchProperties_Impl
),
468 m_pPropSet(aSwMapProvider
.GetPropertySet(PROPERTY_MAP_TEXT_SEARCH
)),
475 bSimilarity(sal_False
),
476 bLevRelax(sal_False
),
480 bIsValueSearch(sal_True
)
484 SwXTextSearch::~SwXTextSearch()
486 delete pSearchProperties
;
487 delete pReplaceProperties
;
492 class theSwXTextSearchUnoTunnelId
: public rtl::Static
< UnoTunnelIdInit
, theSwXTextSearchUnoTunnelId
> {};
495 const uno::Sequence
< sal_Int8
> & SwXTextSearch::getUnoTunnelId()
497 return theSwXTextSearchUnoTunnelId::get().getSeq();
500 sal_Int64 SAL_CALL
SwXTextSearch::getSomething( const uno::Sequence
< sal_Int8
>& rId
)
501 throw(uno::RuntimeException
)
503 if( rId
.getLength() == 16
504 && 0 == memcmp( getUnoTunnelId().getConstArray(),
505 rId
.getConstArray(), 16 ) )
507 return sal::static_int_cast
< sal_Int64
>( reinterpret_cast< sal_IntPtr
>(this) );
512 OUString
SwXTextSearch::getSearchString(void) throw( uno::RuntimeException
)
514 SolarMutexGuard aGuard
;
518 void SwXTextSearch::setSearchString(const OUString
& rString
)
519 throw( uno::RuntimeException
)
521 SolarMutexGuard aGuard
;
522 sSearchText
= String(rString
);
525 OUString
SwXTextSearch::getReplaceString(void) throw( uno::RuntimeException
)
527 SolarMutexGuard aGuard
;
531 void SwXTextSearch::setReplaceString(const OUString
& rReplaceString
) throw( uno::RuntimeException
)
533 SolarMutexGuard aGuard
;
534 sReplaceText
= String(rReplaceString
);
537 uno::Reference
< beans::XPropertySetInfo
> SwXTextSearch::getPropertySetInfo(void) throw( uno::RuntimeException
)
539 static uno::Reference
< beans::XPropertySetInfo
> aRef
= m_pPropSet
->getPropertySetInfo();
543 void SwXTextSearch::setPropertyValue(const OUString
& rPropertyName
, const uno::Any
& aValue
)
544 throw( beans::UnknownPropertyException
, beans::PropertyVetoException
,
545 lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
547 SolarMutexGuard aGuard
;
548 const SfxItemPropertySimpleEntry
* pEntry
= m_pPropSet
->getPropertyMap().getByName(rPropertyName
);
551 if ( pEntry
->nFlags
& beans::PropertyAttribute::READONLY
)
552 throw beans::PropertyVetoException ( OUString( "Property is read-only: " ) + rPropertyName
, static_cast < cppu::OWeakObject
* > ( this ) );
553 sal_Bool bVal
= sal_False
;
554 if(aValue
.getValueType() == ::getBooleanCppuType())
555 bVal
= *(sal_Bool
*)aValue
.getValue();
558 case WID_SEARCH_ALL
: bAll
= bVal
; break;
559 case WID_WORDS
: bWord
= bVal
; break;
560 case WID_BACKWARDS
: bBack
= bVal
; break;
561 case WID_REGULAR_EXPRESSION
: bExpr
= bVal
; break;
562 case WID_CASE_SENSITIVE
: bCase
= bVal
; break;
563 //case WID_IN_SELECTION : bInSel = bVal; break;
564 case WID_STYLES
: bStyles
= bVal
; break;
565 case WID_SIMILARITY
: bSimilarity
= bVal
; break;
566 case WID_SIMILARITY_RELAX
: bLevRelax
= bVal
; break;
567 case WID_SIMILARITY_EXCHANGE
: aValue
>>= nLevExchange
; break;
568 case WID_SIMILARITY_ADD
: aValue
>>= nLevAdd
; break;
569 case WID_SIMILARITY_REMOVE
: aValue
>>= nLevRemove
;break;
573 throw beans::UnknownPropertyException(OUString( "Unknown property: " ) + rPropertyName
, static_cast < cppu::OWeakObject
* > ( this ) );
576 uno::Any
SwXTextSearch::getPropertyValue(const OUString
& rPropertyName
) throw( beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
578 SolarMutexGuard aGuard
;
581 const SfxItemPropertySimpleEntry
* pEntry
= m_pPropSet
->getPropertyMap().getByName(rPropertyName
);
582 sal_Bool bSet
= sal_False
;
588 case WID_SEARCH_ALL
: bSet
= bAll
; goto SET_BOOL
;
589 case WID_WORDS
: bSet
= bWord
; goto SET_BOOL
;
590 case WID_BACKWARDS
: bSet
= bBack
; goto SET_BOOL
;
591 case WID_REGULAR_EXPRESSION
: bSet
= bExpr
; goto SET_BOOL
;
592 case WID_CASE_SENSITIVE
: bSet
= bCase
; goto SET_BOOL
;
593 //case WID_IN_SELECTION : bSet = bInSel; goto SET_BOOL;
594 case WID_STYLES
: bSet
= bStyles
; goto SET_BOOL
;
595 case WID_SIMILARITY
: bSet
= bSimilarity
; goto SET_BOOL
;
596 case WID_SIMILARITY_RELAX
: bSet
= bLevRelax
;
598 aRet
.setValue(&bSet
, ::getBooleanCppuType());
600 case WID_SIMILARITY_EXCHANGE
: nSet
= nLevExchange
; goto SET_UINT16
;
601 case WID_SIMILARITY_ADD
: nSet
= nLevAdd
; goto SET_UINT16
;
602 case WID_SIMILARITY_REMOVE
: nSet
= nLevRemove
;
609 throw beans::UnknownPropertyException(OUString( "Unknown property: " ) + rPropertyName
, static_cast < cppu::OWeakObject
* > ( this ) );
613 void SwXTextSearch::addPropertyChangeListener(const OUString
& /*rPropertyName*/, const uno::Reference
< beans::XPropertyChangeListener
> & /*xListener*/) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
615 OSL_FAIL("not implemented");
618 void SwXTextSearch::removePropertyChangeListener(const OUString
& /*rPropertyName*/, const uno::Reference
< beans::XPropertyChangeListener
> & /*xListener*/) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
,uno::RuntimeException
)
620 OSL_FAIL("not implemented");
623 void SwXTextSearch::addVetoableChangeListener(const OUString
& /*rPropertyName*/, const uno::Reference
< beans::XVetoableChangeListener
> & /*xListener*/) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
,uno::RuntimeException
)
625 OSL_FAIL("not implemented");
628 void SwXTextSearch::removeVetoableChangeListener(const OUString
& /*rPropertyName*/, const uno::Reference
< beans::XVetoableChangeListener
> & /*xListener*/) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
,uno::RuntimeException
)
630 OSL_FAIL("not implemented");
633 sal_Bool
SwXTextSearch::getValueSearch(void) throw( uno::RuntimeException
)
635 SolarMutexGuard aGuard
;
636 return bIsValueSearch
;
639 void SwXTextSearch::setValueSearch(sal_Bool ValueSearch_
) throw( uno::RuntimeException
)
641 SolarMutexGuard aGuard
;
642 bIsValueSearch
= ValueSearch_
;
645 uno::Sequence
< beans::PropertyValue
> SwXTextSearch::getSearchAttributes(void) throw( uno::RuntimeException
)
647 return pSearchProperties
->GetProperties();
650 void SwXTextSearch::setSearchAttributes(const uno::Sequence
< beans::PropertyValue
>& rSearchAttribs
)
651 throw( beans::UnknownPropertyException
, lang::IllegalArgumentException
, uno::RuntimeException
)
653 pSearchProperties
->SetProperties(rSearchAttribs
);
656 uno::Sequence
< beans::PropertyValue
> SwXTextSearch::getReplaceAttributes(void)
657 throw( uno::RuntimeException
)
659 return pReplaceProperties
->GetProperties();
662 void SwXTextSearch::setReplaceAttributes(const uno::Sequence
< beans::PropertyValue
>& rReplaceAttribs
)
663 throw( beans::UnknownPropertyException
, lang::IllegalArgumentException
, uno::RuntimeException
)
665 pReplaceProperties
->SetProperties(rReplaceAttribs
);
668 void SwXTextSearch::FillSearchItemSet(SfxItemSet
& rSet
) const
670 pSearchProperties
->FillItemSet(rSet
, bIsValueSearch
);
673 void SwXTextSearch::FillReplaceItemSet(SfxItemSet
& rSet
) const
675 pReplaceProperties
->FillItemSet(rSet
, bIsValueSearch
);
678 sal_Bool
SwXTextSearch::HasSearchAttributes() const
680 return pSearchProperties
->HasAttributes();
683 sal_Bool
SwXTextSearch::HasReplaceAttributes() const
685 return pReplaceProperties
->HasAttributes();
688 OUString
SwXTextSearch::getImplementationName(void) throw( uno::RuntimeException
)
690 return OUString("SwXTextSearch");
693 sal_Bool
SwXTextSearch::supportsService(const OUString
& rServiceName
) throw( uno::RuntimeException
)
695 return cppu::supportsService(this, rServiceName
);
698 uno::Sequence
< OUString
> SwXTextSearch::getSupportedServiceNames(void) throw( uno::RuntimeException
)
700 uno::Sequence
< OUString
> aRet(2);
701 OUString
* pArray
= aRet
.getArray();
702 pArray
[0] = "com.sun.star.util.SearchDescriptor";
703 pArray
[1] = "com.sun.star.util.ReplaceDescriptor";
707 void SwXTextSearch::FillSearchOptions( util::SearchOptions
& rSearchOpt
) const
711 rSearchOpt
.algorithmType
= util::SearchAlgorithms_APPROXIMATE
;
712 rSearchOpt
.changedChars
= nLevExchange
;
713 rSearchOpt
.deletedChars
= nLevRemove
;
714 rSearchOpt
.insertedChars
= nLevAdd
;
716 rSearchOpt
.searchFlag
|= util::SearchFlags::LEV_RELAXED
;
719 rSearchOpt
.algorithmType
= util::SearchAlgorithms_REGEXP
;
721 rSearchOpt
.algorithmType
= util::SearchAlgorithms_ABSOLUTE
;
723 rSearchOpt
.Locale
= GetAppLanguageTag().getLocale();
724 rSearchOpt
.searchString
= sSearchText
;
725 rSearchOpt
.replaceString
= sReplaceText
;
728 rSearchOpt
.transliterateFlags
|= i18n::TransliterationModules_IGNORE_CASE
;
730 rSearchOpt
.searchFlag
|= util::SearchFlags::NORM_WORD_ONLY
;
732 // bInSel: 1; // wie geht das?
733 // TODO: pSearch->bStyles!
735 // aSrchParam.SetSrchInSelection(TypeConversion::toBOOL(aVal));
738 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */