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 <hintids.hxx>
21 #include <unosrch.hxx>
22 #include <unomap.hxx>
23 #include <swtypes.hxx>
24 
25 #include <osl/diagnose.h>
26 #include <i18nlangtag/languagetag.hxx>
27 #include <i18nutil/searchopt.hxx>
28 #include <o3tl/any.hxx>
29 #include <vcl/svapp.hxx>
30 #include <com/sun/star/util/SearchAlgorithms2.hpp>
31 #include <com/sun/star/util/SearchFlags.hpp>
32 #include <com/sun/star/beans/PropertyAttribute.hpp>
33 #include <comphelper/servicehelper.hxx>
34 #include <cppuhelper/supportsservice.hxx>
35 #include <svl/itemprop.hxx>
36 #include <svl/itempool.hxx>
37 #include <memory>
38 
39 using namespace ::com::sun::star;
40 
41 class SwSearchProperties_Impl
42 {
43     std::unordered_map<OUString, beans::PropertyValue> maValues;
44     SfxItemPropertyMap                              mrMap;
45 
46     SwSearchProperties_Impl(const SwSearchProperties_Impl&) = delete;
47     SwSearchProperties_Impl& operator=(const SwSearchProperties_Impl&) = delete;
48 
49 public:
50     SwSearchProperties_Impl();
51 
52     /// @throws beans::UnknownPropertyException
53     /// @throws lang::IllegalArgumentException
54     /// @throws uno::RuntimeException
55     void    SetProperties(const uno::Sequence< beans::PropertyValue >& aSearchAttribs);
56     uno::Sequence< beans::PropertyValue > GetProperties() const;
57 
58     void    FillItemSet(SfxItemSet& rSet, bool bIsValueSearch) const;
59     bool    HasAttributes() const;
60 };
61 
SwSearchProperties_Impl()62 SwSearchProperties_Impl::SwSearchProperties_Impl() :
63     mrMap( aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)->getPropertyMap() )
64 {
65 }
66 
SetProperties(const uno::Sequence<beans::PropertyValue> & aSearchAttribs)67 void SwSearchProperties_Impl::SetProperties(const uno::Sequence< beans::PropertyValue >& aSearchAttribs)
68 {
69     //delete all existing values
70     maValues.clear();
71 
72     for(const beans::PropertyValue& rSearchAttrib : aSearchAttribs)
73     {
74         const OUString& sName = rSearchAttrib.Name;
75         if( !mrMap.hasPropertyByName(sName) )
76             throw beans::UnknownPropertyException(sName);
77         maValues[sName] = rSearchAttrib;
78     }
79 }
80 
GetProperties() const81 uno::Sequence< beans::PropertyValue > SwSearchProperties_Impl::GetProperties() const
82 {
83     uno::Sequence< beans::PropertyValue > aRet(maValues.size());
84     beans::PropertyValue* pProps = aRet.getArray();
85     sal_Int32 nPropCount = 0;
86     for(auto const & rPair : maValues)
87     {
88        pProps[nPropCount++] = rPair.second;
89     }
90     return aRet;
91 }
92 
FillItemSet(SfxItemSet & rSet,bool bIsValueSearch) const93 void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, bool bIsValueSearch) const
94 {
95 
96     std::unique_ptr<SfxPoolItem> pBoxItem,
97     pCharBoxItem,
98     pBreakItem,
99     pAutoKernItem ,
100     pWLineItem  ,
101     pTabItem ,
102     pSplitItem ,
103     pRegItem ,
104     pLineSpaceItem ,
105     pLineNumItem ,
106     pKeepItem ,
107     pLRItem ,
108     pULItem ,
109     pBackItem ,
110     pAdjItem ,
111     pDescItem ,
112     pInetItem ,
113     pDropItem ,
114     pWeightItem ,
115     pULineItem ,
116     pOLineItem ,
117     pCharFormatItem ,
118     pShadItem ,
119     pPostItem ,
120     pNHyphItem ,
121     pLangItem ,
122     pKernItem ,
123     pFontSizeItem ,
124     pFontItem ,
125     pBlinkItem ,
126     pEscItem ,
127     pCrossedOutItem ,
128     pContourItem ,
129     pCharColorItem ,
130     pCasemapItem ,
131     pBrushItem ,
132     pFontCJKItem,
133     pFontSizeCJKItem,
134     pCJKLangItem,
135     pCJKPostureItem,
136     pCJKWeightItem,
137     pFontCTLItem,
138     pFontSizeCTLItem,
139     pCTLLangItem,
140     pCTLPostureItem,
141     pCTLWeightItem,
142     pShadowItem ;
143 
144     auto funcClone = [&rSet](sal_uInt16 nWID, std::unique_ptr<SfxPoolItem> & rpPoolItem)
145     {
146         if(!rpPoolItem)
147             rpPoolItem.reset(rSet.GetPool()->GetDefaultItem(nWID).Clone());
148         return rpPoolItem.get();
149     };
150     for(auto const & rPair : maValues)
151     {
152         SfxPoolItem* pTempItem = nullptr;
153         const SfxItemPropertyMapEntry* pPropEntry = mrMap.getByName(rPair.first);
154         assert(pPropEntry && "SetProperties only enters values into maValues if mrMap.hasPropertyByName() wass true");
155         const SfxItemPropertyMapEntry & rPropEntry = *pPropEntry;
156         sal_uInt16 nWID = rPropEntry.nWID;
157         switch(nWID)
158         {
159             case  RES_BOX:
160                 pTempItem = funcClone(nWID, pBoxItem);
161             break;
162             case  RES_CHRATR_BOX:
163                 pTempItem = funcClone(nWID, pCharBoxItem);
164             break;
165             case  RES_BREAK:
166                 pTempItem = funcClone(nWID, pBreakItem);
167             break;
168             case  RES_CHRATR_AUTOKERN:
169                 pTempItem = funcClone(nWID, pAutoKernItem);
170                 break;
171             case  RES_CHRATR_BACKGROUND:
172                 pTempItem = funcClone(nWID, pBrushItem);
173             break;
174             case  RES_CHRATR_CASEMAP:
175                 pTempItem = funcClone(nWID, pCasemapItem);
176             break;
177             case  RES_CHRATR_COLOR:
178                 pTempItem = funcClone(nWID, pCharColorItem);
179             break;
180             case  RES_CHRATR_CONTOUR:
181                 pTempItem = funcClone(nWID, pContourItem);
182             break;
183             case  RES_CHRATR_CROSSEDOUT:
184                 pTempItem = funcClone(nWID, pCrossedOutItem);
185             break;
186             case  RES_CHRATR_ESCAPEMENT:
187                 pTempItem = funcClone(nWID, pEscItem);
188             break;
189             case  RES_CHRATR_BLINK:
190                 pTempItem = funcClone(nWID, pBlinkItem);
191             break;
192             case  RES_CHRATR_FONT:
193                 pTempItem = funcClone(nWID, pFontItem);
194             break;
195             case  RES_CHRATR_FONTSIZE:
196                 pTempItem = funcClone(nWID, pFontSizeItem);
197             break;
198             case  RES_CHRATR_KERNING:
199                 pTempItem = funcClone(nWID, pKernItem);
200             break;
201             case  RES_CHRATR_LANGUAGE:
202                 pTempItem = funcClone(nWID, pLangItem);
203             break;
204             case  RES_CHRATR_NOHYPHEN:
205                 pTempItem = funcClone(nWID, pNHyphItem);
206             break;
207             case  RES_CHRATR_POSTURE:
208                 pTempItem = funcClone(nWID, pPostItem);
209             break;
210             case  RES_CHRATR_SHADOWED:
211                 pTempItem = funcClone(nWID, pShadItem);
212             break;
213             case  RES_TXTATR_CHARFMT:
214                 pTempItem = funcClone(nWID, pCharFormatItem);
215             break;
216             case  RES_CHRATR_UNDERLINE:
217                 pTempItem = funcClone(nWID, pULineItem);
218             break;
219             case  RES_CHRATR_OVERLINE:
220                 pTempItem = funcClone(nWID, pOLineItem);
221             break;
222             case  RES_CHRATR_WEIGHT:
223                 pTempItem = funcClone(nWID, pWeightItem);
224             break;
225             case  RES_PARATR_DROP:
226                 pTempItem = funcClone(nWID, pDropItem);
227             break;
228             case  RES_TXTATR_INETFMT:
229                 pTempItem = funcClone(nWID, pInetItem);
230             break;
231             case  RES_PAGEDESC:
232                 pTempItem = funcClone(nWID, pDescItem);
233             break;
234             case  RES_PARATR_ADJUST:
235                 pTempItem = funcClone(nWID, pAdjItem);
236             break;
237             case  RES_BACKGROUND:
238                 pTempItem = funcClone(nWID, pBackItem);
239             break;
240             case  RES_UL_SPACE:
241                 pTempItem = funcClone(nWID, pULItem);
242             break;
243             case  RES_LR_SPACE:
244                 pTempItem = funcClone(nWID, pLRItem);
245             break;
246             case  RES_KEEP:
247                 pTempItem = funcClone(nWID, pKeepItem);
248             break;
249             case  RES_LINENUMBER:
250                 pTempItem = funcClone(nWID, pLineNumItem);
251             break;
252             case  RES_PARATR_LINESPACING:
253                 pTempItem = funcClone(nWID, pLineSpaceItem);
254             break;
255             case  RES_PARATR_REGISTER:
256                 pTempItem = funcClone(nWID, pRegItem);
257             break;
258             case  RES_PARATR_SPLIT:
259                 pTempItem = funcClone(nWID, pSplitItem);
260             break;
261             case  RES_PARATR_TABSTOP:
262                 pTempItem = funcClone(nWID, pTabItem);
263             break;
264             case  RES_CHRATR_WORDLINEMODE:
265                 pTempItem = funcClone(nWID, pWLineItem);
266             break;
267             case RES_CHRATR_CJK_FONT:
268                 pTempItem = funcClone(nWID, pFontCJKItem);
269             break;
270             case RES_CHRATR_CJK_FONTSIZE:
271                 pTempItem = funcClone(nWID, pFontSizeCJKItem);
272             break;
273             case RES_CHRATR_CJK_LANGUAGE:
274                 pTempItem = funcClone(nWID, pCJKLangItem);
275             break;
276             case RES_CHRATR_CJK_POSTURE:
277                 pTempItem = funcClone(nWID, pCJKPostureItem);
278             break;
279             case RES_CHRATR_CJK_WEIGHT:
280                 pTempItem = funcClone(nWID, pCJKWeightItem);
281             break;
282             case RES_CHRATR_CTL_FONT:
283                 pTempItem = funcClone(nWID, pFontCTLItem);
284             break;
285             case RES_CHRATR_CTL_FONTSIZE:
286                 pTempItem = funcClone(nWID, pFontSizeCTLItem);
287             break;
288             case RES_CHRATR_CTL_LANGUAGE:
289                 pTempItem = funcClone(nWID, pCTLLangItem);
290             break;
291             case RES_CHRATR_CTL_POSTURE:
292                 pTempItem = funcClone(nWID, pCTLPostureItem);
293             break;
294             case RES_CHRATR_CTL_WEIGHT:
295                 pTempItem = funcClone(nWID, pCTLWeightItem);
296             break;
297             case RES_CHRATR_SHADOW:
298                 pTempItem = funcClone(nWID, pShadowItem);
299             break;
300         }
301         if(pTempItem)
302         {
303             if(bIsValueSearch)
304             {
305                 pTempItem->PutValue(rPair.second.Value, rPropEntry.nMemberId);
306                 rSet.Put(*pTempItem);
307             }
308             else
309                 rSet.InvalidateItem( pTempItem->Which() );
310         }
311     }
312 }
313 
HasAttributes() const314 bool SwSearchProperties_Impl::HasAttributes() const
315 {
316     return !maValues.empty();
317 }
318 
SwXTextSearch()319 SwXTextSearch::SwXTextSearch() :
320     m_pSearchProperties( new SwSearchProperties_Impl),
321     m_pReplaceProperties( new SwSearchProperties_Impl),
322     m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SEARCH)),
323     m_bAll(false),
324     m_bWord(false),
325     m_bBack(false),
326     m_bExpr(false),
327     m_bCase(false),
328     m_bStyles(false),
329     m_bSimilarity(false),
330     m_bLevRelax(false),
331     m_nLevExchange(2),
332     m_nLevAdd(2),
333     m_nLevRemove(2),
334     m_bIsValueSearch(true)
335 {
336 }
337 
~SwXTextSearch()338 SwXTextSearch::~SwXTextSearch()
339 {
340     m_pSearchProperties.reset();
341     m_pReplaceProperties.reset();
342 }
343 
344 namespace
345 {
346 }
347 
getUnoTunnelId()348 const uno::Sequence< sal_Int8 > & SwXTextSearch::getUnoTunnelId()
349 {
350     static const UnoTunnelIdInit theSwXTextSearchUnoTunnelId;
351     return theSwXTextSearchUnoTunnelId.getSeq();
352 }
353 
getSomething(const uno::Sequence<sal_Int8> & rId)354 sal_Int64 SAL_CALL SwXTextSearch::getSomething( const uno::Sequence< sal_Int8 >& rId )
355 {
356     if( isUnoTunnelId<SwXTextSearch>(rId) )
357     {
358         return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
359     }
360     return 0;
361 }
362 
getSearchString()363 OUString SwXTextSearch::getSearchString()
364 {
365     SolarMutexGuard aGuard;
366     return m_sSearchText;
367 }
368 
setSearchString(const OUString & rString)369 void SwXTextSearch::setSearchString(const OUString& rString)
370 {
371     SolarMutexGuard aGuard;
372     m_sSearchText = rString;
373 }
374 
getReplaceString()375 OUString SwXTextSearch::getReplaceString()
376 {
377     SolarMutexGuard aGuard;
378     return m_sReplaceText;
379 }
380 
setReplaceString(const OUString & rReplaceString)381 void SwXTextSearch::setReplaceString(const OUString& rReplaceString)
382 {
383     SolarMutexGuard aGuard;
384     m_sReplaceText = rReplaceString;
385 }
386 
getPropertySetInfo()387 uno::Reference< beans::XPropertySetInfo >  SwXTextSearch::getPropertySetInfo()
388 {
389     static uno::Reference< beans::XPropertySetInfo >  aRef = m_pPropSet->getPropertySetInfo();
390     return aRef;
391 }
392 
setPropertyValue(const OUString & rPropertyName,const uno::Any & aValue)393 void SwXTextSearch::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
394 {
395     SolarMutexGuard aGuard;
396     const SfxItemPropertyMapEntry*  pEntry = m_pPropSet->getPropertyMap().getByName(rPropertyName);
397     if(!pEntry)
398         throw beans::UnknownPropertyException("Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
399 
400     if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
401         throw beans::PropertyVetoException ("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
402     bool bVal = false;
403     if(auto b = o3tl::tryAccess<bool>(aValue))
404         bVal = *b;
405     switch(pEntry->nWID)
406     {
407         case WID_SEARCH_ALL :           m_bAll        = bVal; break;
408         case WID_WORDS:                 m_bWord       = bVal; break;
409         case WID_BACKWARDS :            m_bBack       = bVal; break;
410         case WID_REGULAR_EXPRESSION :   m_bExpr       = bVal; break;
411         case WID_CASE_SENSITIVE  :      m_bCase       = bVal; break;
412         //case WID_IN_SELECTION  :      bInSel      = bVal; break;
413         case WID_STYLES          :      m_bStyles     = bVal; break;
414         case WID_SIMILARITY      :      m_bSimilarity = bVal; break;
415         case WID_SIMILARITY_RELAX:      m_bLevRelax   = bVal; break;
416         case WID_SIMILARITY_EXCHANGE:   aValue >>= m_nLevExchange; break;
417         case WID_SIMILARITY_ADD:        aValue >>= m_nLevAdd; break;
418         case WID_SIMILARITY_REMOVE :    aValue >>= m_nLevRemove;break;
419     };
420 
421 }
422 
getPropertyValue(const OUString & rPropertyName)423 uno::Any SwXTextSearch::getPropertyValue(const OUString& rPropertyName)
424 {
425     SolarMutexGuard aGuard;
426     uno::Any aRet;
427 
428     const SfxItemPropertyMapEntry*  pEntry = m_pPropSet->getPropertyMap().getByName(rPropertyName);
429     bool bSet = false;
430     if(!pEntry)
431         throw beans::UnknownPropertyException("Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
432 
433     sal_Int16 nSet = 0;
434     switch(pEntry->nWID)
435     {
436         case WID_SEARCH_ALL :           bSet = m_bAll; goto SET_BOOL;
437         case WID_WORDS:                 bSet = m_bWord; goto SET_BOOL;
438         case WID_BACKWARDS :            bSet = m_bBack; goto SET_BOOL;
439         case WID_REGULAR_EXPRESSION :   bSet = m_bExpr; goto SET_BOOL;
440         case WID_CASE_SENSITIVE  :      bSet = m_bCase; goto SET_BOOL;
441         //case WID_IN_SELECTION  :      bSet = bInSel; goto SET_BOOL;
442         case WID_STYLES          :      bSet = m_bStyles; goto SET_BOOL;
443         case WID_SIMILARITY      :      bSet = m_bSimilarity; goto SET_BOOL;
444         case WID_SIMILARITY_RELAX:      bSet = m_bLevRelax;
445 SET_BOOL:
446         aRet <<= bSet;
447         break;
448         case WID_SIMILARITY_EXCHANGE:   nSet = m_nLevExchange; goto SET_UINT16;
449         case WID_SIMILARITY_ADD:        nSet = m_nLevAdd; goto SET_UINT16;
450         case WID_SIMILARITY_REMOVE :    nSet = m_nLevRemove;
451 SET_UINT16:
452         aRet <<= nSet;
453         break;
454     }
455 
456     return aRet;
457 }
458 
addPropertyChangeListener(const OUString &,const uno::Reference<beans::XPropertyChangeListener> &)459 void SwXTextSearch::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
460 {
461     OSL_FAIL("not implemented");
462 }
463 
removePropertyChangeListener(const OUString &,const uno::Reference<beans::XPropertyChangeListener> &)464 void SwXTextSearch::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
465 {
466     OSL_FAIL("not implemented");
467 }
468 
addVetoableChangeListener(const OUString &,const uno::Reference<beans::XVetoableChangeListener> &)469 void SwXTextSearch::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
470 {
471     OSL_FAIL("not implemented");
472 }
473 
removeVetoableChangeListener(const OUString &,const uno::Reference<beans::XVetoableChangeListener> &)474 void SwXTextSearch::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
475 {
476     OSL_FAIL("not implemented");
477 }
478 
getValueSearch()479 sal_Bool SwXTextSearch::getValueSearch()
480 {
481     SolarMutexGuard aGuard;
482     return m_bIsValueSearch;
483 }
484 
setValueSearch(sal_Bool ValueSearch_)485 void SwXTextSearch::setValueSearch(sal_Bool ValueSearch_)
486 {
487     SolarMutexGuard aGuard;
488     m_bIsValueSearch = ValueSearch_;
489 }
490 
getSearchAttributes()491 uno::Sequence< beans::PropertyValue > SwXTextSearch::getSearchAttributes()
492 {
493     return  m_pSearchProperties->GetProperties();
494 }
495 
setSearchAttributes(const uno::Sequence<beans::PropertyValue> & rSearchAttribs)496 void SwXTextSearch::setSearchAttributes(const uno::Sequence< beans::PropertyValue >& rSearchAttribs)
497 {
498     m_pSearchProperties->SetProperties(rSearchAttribs);
499 }
500 
getReplaceAttributes()501 uno::Sequence< beans::PropertyValue > SwXTextSearch::getReplaceAttributes()
502 {
503     return m_pReplaceProperties->GetProperties();
504 }
505 
setReplaceAttributes(const uno::Sequence<beans::PropertyValue> & rReplaceAttribs)506 void SwXTextSearch::setReplaceAttributes(const uno::Sequence< beans::PropertyValue >& rReplaceAttribs)
507 {
508     m_pReplaceProperties->SetProperties(rReplaceAttribs);
509 }
510 
FillSearchItemSet(SfxItemSet & rSet) const511 void    SwXTextSearch::FillSearchItemSet(SfxItemSet& rSet) const
512 {
513     m_pSearchProperties->FillItemSet(rSet, m_bIsValueSearch);
514 }
515 
FillReplaceItemSet(SfxItemSet & rSet) const516 void    SwXTextSearch::FillReplaceItemSet(SfxItemSet& rSet) const
517 {
518     m_pReplaceProperties->FillItemSet(rSet, m_bIsValueSearch);
519 }
520 
HasSearchAttributes() const521 bool    SwXTextSearch::HasSearchAttributes() const
522 {
523     return m_pSearchProperties->HasAttributes();
524 }
525 
HasReplaceAttributes() const526 bool    SwXTextSearch::HasReplaceAttributes() const
527 {
528     return m_pReplaceProperties->HasAttributes();
529 }
530 
getImplementationName()531 OUString SwXTextSearch::getImplementationName()
532 {
533     return "SwXTextSearch";
534 }
535 
supportsService(const OUString & rServiceName)536 sal_Bool SwXTextSearch::supportsService(const OUString& rServiceName)
537 {
538     return cppu::supportsService(this, rServiceName);
539 }
540 
getSupportedServiceNames()541 uno::Sequence< OUString > SwXTextSearch::getSupportedServiceNames()
542 {
543     return { "com.sun.star.util.SearchDescriptor", "com.sun.star.util.ReplaceDescriptor" };
544 }
545 
FillSearchOptions(i18nutil::SearchOptions2 & rSearchOpt) const546 void SwXTextSearch::FillSearchOptions( i18nutil::SearchOptions2& rSearchOpt ) const
547 {
548     if( m_bSimilarity )
549     {
550         rSearchOpt.algorithmType = util::SearchAlgorithms_APPROXIMATE;
551         rSearchOpt.AlgorithmType2 = util::SearchAlgorithms2::APPROXIMATE;
552         rSearchOpt.changedChars = m_nLevExchange;
553         rSearchOpt.deletedChars = m_nLevRemove;
554         rSearchOpt.insertedChars = m_nLevAdd;
555         if( m_bLevRelax )
556             rSearchOpt.searchFlag |= util::SearchFlags::LEV_RELAXED;
557     }
558     else if( m_bExpr )
559     {
560         rSearchOpt.algorithmType = util::SearchAlgorithms_REGEXP;
561         rSearchOpt.AlgorithmType2 = util::SearchAlgorithms2::REGEXP;
562     }
563     else
564     {
565         rSearchOpt.algorithmType = util::SearchAlgorithms_ABSOLUTE;
566         rSearchOpt.AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
567     }
568 
569     rSearchOpt.Locale = GetAppLanguageTag().getLocale();
570     rSearchOpt.searchString = m_sSearchText;
571     rSearchOpt.replaceString = m_sReplaceText;
572 
573     if( !m_bCase )
574         rSearchOpt.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
575     if( m_bWord )
576         rSearchOpt.searchFlag |= util::SearchFlags::NORM_WORD_ONLY;
577 
578 //  bInSel: 1;  // How is that possible?
579 //  TODO: pSearch->bStyles!
580 //      inSelection??
581 //      aSrchParam.SetSrchInSelection(TypeConversion::toBOOL(aVal));
582 }
583 
584 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
585