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