LibreOffice Module sd (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 <memory>
21#include <sal/config.h>
22
23#include <com/sun/star/drawing/XShapes.hpp>
24#include <com/sun/star/drawing/XDrawPage.hpp>
25#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
26#include <utility>
27#include <vcl/svapp.hxx>
28
29#include <svx/svdobj.hxx>
30#include <svx/svdpool.hxx>
31#include <editeng/unoipset.hxx>
32#include <editeng/unotext.hxx>
33#include <tools/debug.hxx>
34
35#include <unoprnms.hxx>
36#include <unosrch.hxx>
37
38using namespace ::com::sun::star;
39
40#define WID_SEARCH_BACKWARDS 0
41#define WID_SEARCH_CASE 1
42#define WID_SEARCH_WORDS 2
43
45{
46 static const SfxItemPropertyMapEntry aSearchPropertyMap_Impl[] =
47 {
51 };
52
53 return aSearchPropertyMap_Impl;
54}
55
56namespace {
57
58class SearchContext_impl
59{
60 uno::Reference< drawing::XShapes > mxShapes;
61 sal_Int32 mnIndex;
62
63public:
64 SearchContext_impl(uno::Reference<drawing::XShapes> xShapes)
65 : mxShapes(std::move( xShapes )), mnIndex( -1 ) {}
66
67 uno::Reference< drawing::XShape > firstShape()
68 {
69 mnIndex = -1;
70 return nextShape();
71 }
72
73 uno::Reference< drawing::XShape > nextShape()
74 {
75 uno::Reference< drawing::XShape > xShape;
76 mnIndex++;
77 if( mxShapes.is() && mxShapes->getCount() > mnIndex )
78 {
79 mxShapes->getByIndex( mnIndex ) >>= xShape;
80 }
81 return xShape;
82 }
83};
84
85}
86
87/* ================================================================= */
92SdUnoSearchReplaceShape::SdUnoSearchReplaceShape( drawing::XDrawPage* pPage ) noexcept
93 : mpPage(pPage)
94{
95}
96
98{
99}
100
101// util::XReplaceable
102uno::Reference< util::XReplaceDescriptor > SAL_CALL SdUnoSearchReplaceShape::createReplaceDescriptor()
103{
105}
106
107sal_Int32 SAL_CALL SdUnoSearchReplaceShape::replaceAll( const uno::Reference< util::XSearchDescriptor >& xDesc )
108{
109 SdUnoSearchReplaceDescriptor* pDescr = dynamic_cast<SdUnoSearchReplaceDescriptor*>( xDesc.get() );
110 if( pDescr == nullptr )
111 return 0;
112
113 sal_Int32 nFound = 0;
114
115 uno::Reference< drawing::XShapes > xShapes;
116 uno::Reference< drawing::XShape > xShape;
117
118 std::vector<SearchContext_impl> aContexts;
119 if(mpPage)
120 {
121 xShapes = mpPage;
122
123 if( xShapes->getCount() )
124 {
125 aContexts.push_back(SearchContext_impl(xShapes));
126 xShape = aContexts.back().firstShape();
127 }
128 else
129 {
130 xShapes = nullptr;
131 }
132 }
133
134 while( xShape.is() )
135 {
136 // replace in xShape
137 uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY);
138 uno::Reference< text::XTextRange > xRange = xText;
139 uno::Reference< text::XTextRange > xFound;
140
141 while( xRange.is() )
142 {
143 xFound = Search( xRange, pDescr );
144 if( !xFound.is() )
145 break;
146
147 xFound->setString( pDescr->getReplaceString() );
148 xRange = xFound->getEnd();
149 nFound++;
150 }
151 // done with xShape -> get next shape
152
153 // test if it's a group
154 uno::Reference< drawing::XShapes > xGroupShape( xShape, uno::UNO_QUERY );
155 if( xGroupShape.is() && ( xGroupShape->getCount() > 0 ) )
156 {
157 aContexts.push_back(SearchContext_impl(xGroupShape));
158 xShape = aContexts.back().firstShape();
159 }
160 else
161 {
162 if (!aContexts.empty())
163 xShape = aContexts.back().nextShape();
164 else
165 xShape = nullptr;
166 }
167
168 // test parent contexts for next shape if none
169 // is found in the current context
170 while (!aContexts.empty() && !xShape.is())
171 {
172 aContexts.pop_back();
173 if (!aContexts.empty())
174 xShape = aContexts.back().nextShape();
175 }
176 }
177
178 return nFound;
179}
180
181// XSearchable
182uno::Reference< css::util::XSearchDescriptor > SAL_CALL SdUnoSearchReplaceShape::createSearchDescriptor( )
183{
185}
186
187uno::Reference< css::container::XIndexAccess > SAL_CALL SdUnoSearchReplaceShape::findAll( const css::uno::Reference< css::util::XSearchDescriptor >& xDesc )
188{
189 SdUnoSearchReplaceDescriptor* pDescr = dynamic_cast<SdUnoSearchReplaceDescriptor*>( xDesc.get() );
190 if( pDescr == nullptr )
191 return uno::Reference< container::XIndexAccess > ();
192
193 sal_Int32 nSequence = 32;
194 sal_Int32 nFound = 0;
195
196 uno::Sequence < uno::Reference< uno::XInterface > > aSeq( nSequence );
197
198 uno::Reference< uno::XInterface > * pArray = aSeq.getArray();
199
200 uno::Reference< drawing::XShapes > xShapes;
201 uno::Reference< drawing::XShape > xShape;
202
203 std::vector<SearchContext_impl> aContexts;
204 if(mpPage)
205 {
206 xShapes = mpPage;
207
208 if( xShapes->getCount() > 0 )
209 {
210 aContexts.push_back(SearchContext_impl(xShapes));
211 xShape = aContexts.back().firstShape();
212 }
213 else
214 {
215 xShapes = nullptr;
216 }
217 }
218
219 while( xShape.is() )
220 {
221 // find in xShape
222 uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY);
223 uno::Reference< text::XTextRange > xRange = xText;
224 uno::Reference< text::XTextRange > xFound;
225
226 while( xRange.is() )
227 {
228 xFound = Search( xRange, pDescr );
229 if( !xFound.is() )
230 break;
231
232 if( nFound >= nSequence )
233 {
234 nSequence += 32;
235 aSeq.realloc( nSequence );
236 pArray = aSeq.getArray();
237 }
238
239 pArray[nFound++] = xFound;
240
241 xRange = xFound->getEnd();
242 }
243 // done with shape -> get next shape
244
245 // test if it's a group
246 uno::Reference< drawing::XShapes > xGroupShape;
247 xGroupShape.set( xShape, uno::UNO_QUERY );
248
249 if( xGroupShape.is() && xGroupShape->getCount() > 0 )
250 {
251 aContexts.push_back(SearchContext_impl(xGroupShape));
252 xShape = aContexts.back().firstShape();
253 }
254 else
255 {
256 if (!aContexts.empty())
257 xShape = aContexts.back().nextShape();
258 else
259 xShape = nullptr;
260 }
261
262 // test parent contexts for next shape if none
263 // is found in the current context
264 while (!aContexts.empty() && !xShape.is())
265 {
266 aContexts.pop_back();
267 if (!aContexts.empty())
268 xShape = aContexts.back().nextShape();
269 }
270 }
271
272 if( nFound != nSequence )
273 aSeq.realloc( nFound );
274
275 uno::Reference<css::container::XIndexAccess> xRet(new SdUnoFindAllAccess(aSeq));
276 return xRet;
277}
278
279uno::Reference< css::uno::XInterface > SAL_CALL SdUnoSearchReplaceShape::findFirst( const css::uno::Reference< css::util::XSearchDescriptor >& xDesc )
280{
281 uno::Reference< text::XTextRange > xRange( GetCurrentShape(), uno::UNO_QUERY );
282 if( xRange.is() )
283 return findNext( xRange, xDesc );
284
285 return uno::Reference< uno::XInterface > ();
286}
287
288uno::Reference< drawing::XShape > SdUnoSearchReplaceShape::GetCurrentShape() const noexcept
289{
290 uno::Reference< drawing::XShape > xShape;
291
292 if( mpPage && mpPage->getCount() > 0)
293 mpPage->getByIndex(0) >>= xShape;
294
295 return xShape;
296
297}
298
299uno::Reference< css::uno::XInterface > SAL_CALL SdUnoSearchReplaceShape::findNext( const css::uno::Reference< css::uno::XInterface >& xStartAt, const css::uno::Reference< css::util::XSearchDescriptor >& xDesc )
300{
301 SdUnoSearchReplaceDescriptor* pDescr = dynamic_cast<SdUnoSearchReplaceDescriptor*>( xDesc.get() );
302
303 uno::Reference< uno::XInterface > xFound;
304
305 uno::Reference< text::XTextRange > xRange( xStartAt, uno::UNO_QUERY );
306 if(pDescr && xRange.is() )
307 {
308
309 uno::Reference< text::XTextRange > xCurrentRange( xStartAt, uno::UNO_QUERY );
310
311 uno::Reference< drawing::XShape > xCurrentShape( GetShape( xCurrentRange ) );
312
313 while(!xFound.is() && xRange.is())
314 {
315 xFound = Search( xRange, pDescr );
316 if(!xFound.is())
317 {
318 // we need a new starting range now
319 xRange = nullptr;
320
321 if(mpPage)
322 {
323 // we do a page wide search, so skip to the next shape here
324 // get next shape on our page
325 uno::Reference< drawing::XShape > xFound2( GetNextShape( mpPage, xCurrentShape ) );
326 if( xFound2.is() && (xFound2.get() != xCurrentShape.get()) )
327 xCurrentShape = xFound2;
328 else
329 xCurrentShape = nullptr;
330
331 xRange.set( xCurrentShape, uno::UNO_QUERY );
332 if(!(xCurrentShape.is() && (xRange.is())))
333 xRange = nullptr;
334 }
335 else
336 {
337 // we search only in this shape, so end search if we have
338 // not found anything
339 }
340 }
341 }
342 }
343 return xFound;
344}
345
349uno::Reference< drawing::XShape > SdUnoSearchReplaceShape::GetNextShape( const uno::Reference< container::XIndexAccess >& xShapes, const uno::Reference< drawing::XShape >& xCurrentShape ) noexcept
350{
351 uno::Reference< drawing::XShape > xFound;
352
353 if(xShapes.is() && xCurrentShape.is())
354 {
355 const sal_Int32 nCount = xShapes->getCount();
356 for( sal_Int32 i = 0; i < nCount; i++ )
357 {
358 uno::Reference< drawing::XShape > xSearchShape;
359 xShapes->getByIndex(i) >>= xSearchShape;
360
361 if( xSearchShape.is() )
362 {
363 uno::Reference< container::XIndexAccess > xGroup( xSearchShape, uno::UNO_QUERY );
364
365 if( xCurrentShape.get() == xSearchShape.get() )
366 {
367 if( xGroup.is() && xGroup->getCount() > 0 )
368 {
369 xGroup->getByIndex( 0 ) >>= xFound;
370 }
371 else
372 {
373 i++;
374 if( i < nCount )
375 xShapes->getByIndex( i ) >>= xFound;
376 else
377 xFound = xCurrentShape;
378 }
379
380 break;
381 }
382 else if( xGroup.is() )
383 {
384 xFound = GetNextShape( xGroup, xCurrentShape );
385 if( xFound.is() )
386 {
387 if( xFound.get() == xCurrentShape.get() )
388 {
389 // the current shape was found at the end of the group
390 i++;
391 if( i < nCount )
392 {
393 xShapes->getByIndex(i) >>= xFound;
394 }
395 }
396 break;
397 }
398 }
399 }
400 }
401 }
402
403 return xFound;
404}
405
406uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( const uno::Reference< text::XTextRange >& xText, SdUnoSearchReplaceDescriptor* pDescr )
407{
408 if(!xText.is())
409 return uno::Reference< text::XTextRange > ();
410
411 uno::Reference< text::XText > xParent( xText->getText() );
412
413 if( !xParent.is() )
414 {
415 xParent.set( xText, uno::UNO_QUERY );
416 }
417
418 const OUString aText( xParent->getString() );
419
420 const sal_Int32 nTextLen = aText.getLength();
421
422 std::unique_ptr<sal_Int32[]> pConvertPos( new sal_Int32[nTextLen+2] );
423 std::unique_ptr<sal_Int32[]> pConvertPara( new sal_Int32[nTextLen+2] );
424
425 sal_Int32* pPos = pConvertPos.get();
426 sal_Int32* pPara = pConvertPara.get();
427
428 sal_Int32 nLastPos = 0, nLastPara = 0;
429
430 uno::Reference< container::XEnumerationAccess > xEnumAccess( xParent, uno::UNO_QUERY );
431
432 // first we fill the arrays with the position and paragraph for every character
433 // inside the text
434 if( xEnumAccess.is() )
435 {
436 uno::Reference< container::XEnumeration > xParaEnum( xEnumAccess->createEnumeration() );
437
438 while(xParaEnum->hasMoreElements())
439 {
440 int ndbg = 0;
441 uno::Reference< text::XTextContent > xParagraph( xParaEnum->nextElement(), uno::UNO_QUERY );
442 if( xParagraph.is() )
443 xEnumAccess.set(xParagraph, css::uno::UNO_QUERY);
444 else
445 xEnumAccess.clear();
446
447 if( xEnumAccess.is() )
448 {
449 uno::Reference< container::XEnumeration > xPortionEnum( xEnumAccess->createEnumeration() );
450 if( xPortionEnum.is() )
451 {
452 while(xPortionEnum->hasMoreElements())
453 {
454 uno::Reference< text::XTextRange > xPortion( xPortionEnum->nextElement(), uno::UNO_QUERY );
455 if( xPortion.is() )
456 {
457 const OUString aPortion( xPortion->getString() );
458 const sal_Int32 nLen = aPortion.getLength();
459
460 ESelection aStartSel( GetSelection( xPortion->getStart() ) );
461 ESelection aEndSel( GetSelection( xPortion->getEnd() ) );
462
463 // special case for empty portions with content or length one portions with content (fields)
464 if( (aStartSel.nStartPos == aEndSel.nStartPos) || ( (aStartSel.nStartPos == (aEndSel.nStartPos - 1)) && (nLen > 1) ) )
465 {
466 for( sal_Int32 i = 0; i < nLen; i++ )
467 {
468 if( ndbg < (nTextLen+2) )
469 {
470 *pPos++ = aStartSel.nStartPos;
471 *pPara++ = aStartSel.nStartPara;
472
473 ndbg += 1;
474 }
475 else
476 {
477 OSL_FAIL( "array overflow while searching" );
478 }
479 }
480
481 nLastPos = aStartSel.nStartPos;
482 }
483 // normal case
484 else
485 {
486 for( sal_Int32 i = 0; i < nLen; i++ )
487 {
488 if( ndbg < (nTextLen+2) )
489 {
490 *pPos++ = aStartSel.nStartPos++;
491 *pPara++ = aStartSel.nStartPara;
492
493 ndbg += 1;
494 }
495 else
496 {
497 OSL_FAIL( "array overflow while searching" );
498 }
499 }
500
501 nLastPos = aStartSel.nStartPos - 1;
502 DBG_ASSERT( aEndSel.nStartPos == aStartSel.nStartPos, "Search is not working" );
503 }
504 nLastPara = aStartSel.nStartPara;
505 }
506 }
507 }
508 }
509
510 if( ndbg < (nTextLen+2) )
511 {
512 *pPos++ = nLastPos + 1;
513 *pPara++ = nLastPara;
514 }
515 else
516 {
517 OSL_FAIL( "array overflow while searching" );
518 }
519 }
520 }
521
522 uno::Reference< text::XTextRange > xFound;
523 ESelection aSel;
524
525 if( xText.is() )
526 aSel = GetSelection( xText );
527
528 sal_Int32 nStartPos;
529 sal_Int32 nEndPos = 0;
530 for( nStartPos = 0; nStartPos < nTextLen; nStartPos++ )
531 {
532 if( pConvertPara[nStartPos] == aSel.nStartPara && pConvertPos[nStartPos] == aSel.nStartPos )
533 break;
534 }
535
536 if( Search( aText, nStartPos, nEndPos, pDescr ) )
537 {
538 if( nStartPos <= nTextLen && nEndPos <= nTextLen )
539 {
540 ESelection aSelection( pConvertPara[nStartPos], pConvertPos[nStartPos],
541 pConvertPara[nEndPos], pConvertPos[nEndPos] );
542
543 SvxUnoTextBase* pParent = comphelper::getFromUnoTunnel<SvxUnoTextBase>( xParent );
544
545 if(pParent)
546 {
547 rtl::Reference<SvxUnoTextRange> pRange = new SvxUnoTextRange( *pParent );
548 xFound = pRange;
549 pRange->SetSelection(aSelection);
550 }
551 }
552 else
553 {
554 OSL_FAIL("Array overflow while searching!");
555 }
556 }
557
558 return xFound;
559}
560
561bool SdUnoSearchReplaceShape::Search( const OUString& rText, sal_Int32& nStartPos, sal_Int32& nEndPos, SdUnoSearchReplaceDescriptor* pDescr ) noexcept
562{
563 OUString aSearchStr( pDescr->getSearchString() );
564 OUString aText( rText );
565
566 if( !pDescr->IsCaseSensitive() )
567 {
568 aText = aText.toAsciiLowerCase();
569 aSearchStr = aSearchStr.toAsciiLowerCase();
570 }
571
572 sal_Int32 nFound = aText.indexOf( aSearchStr, nStartPos );
573 if( nFound != -1 )
574 {
575 nStartPos = nFound;
576 nEndPos = nFound + aSearchStr.getLength();
577
578 if(pDescr->IsWords())
579 {
580 if( (nStartPos > 0 && aText[nStartPos-1] > ' ') ||
581 (nEndPos < aText.getLength() && aText[nEndPos] > ' ') )
582 {
583 nStartPos++;
584 return Search( aText, nStartPos, nEndPos, pDescr );
585 }
586 }
587
588 return true;
589 }
590 else
591 return false;
592}
593
594ESelection SdUnoSearchReplaceShape::GetSelection( const uno::Reference< text::XTextRange >& xTextRange ) noexcept
595{
596 ESelection aSel;
597 SvxUnoTextRangeBase* pRange = comphelper::getFromUnoTunnel<SvxUnoTextRangeBase>( xTextRange );
598
599 if(pRange)
600 aSel = pRange->GetSelection();
601
602 return aSel;
603}
604
605uno::Reference< drawing::XShape > SdUnoSearchReplaceShape::GetShape( const uno::Reference< text::XTextRange >& xTextRange ) noexcept
606{
607 uno::Reference< drawing::XShape > xShape;
608
609 if(xTextRange.is())
610 {
611 uno::Reference< text::XText > xText( xTextRange->getText() );
612
613 if(xText.is())
614 {
615 do
616 {
617 xShape.set( xText, uno::UNO_QUERY );
618 if(!xShape.is())
619 {
620 uno::Reference< text::XText > xParent( xText->getText() );
621 if(!xParent.is() || xText.get() == xParent.get())
622 return xShape;
623
624 xText = xParent;
625 }
626 } while( !xShape.is() );
627 }
628 }
629
630 return xShape;
631}
632
633/* ================================================================= */
639{
641
642 mbBackwards = false;
643 mbCaseSensitive = false;
644 mbWords = false;
645}
646
648{
649}
650
651// XSearchDescriptor
653{
654 return maSearchStr;
655}
656
657void SAL_CALL SdUnoSearchReplaceDescriptor::setSearchString( const OUString& aString )
658{
659 maSearchStr = aString;
660}
661
662// XReplaceDescriptor
664{
665 return maReplaceStr;
666}
667
668void SAL_CALL SdUnoSearchReplaceDescriptor::setReplaceString( const OUString& aReplaceString )
669{
670 maReplaceStr = aReplaceString;
671}
672
673// XPropertySet
674uno::Reference< css::beans::XPropertySetInfo > SAL_CALL SdUnoSearchReplaceDescriptor::getPropertySetInfo()
675{
676 SolarMutexGuard aGuard;
677 return mpPropSet->getPropertySetInfo();
678}
679
680void SAL_CALL SdUnoSearchReplaceDescriptor::setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue )
681{
682 SolarMutexGuard aGuard;
683
684 const SfxItemPropertyMapEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName);
685
686 bool bOk = false;
687
688 switch( pEntry ? pEntry->nWID : -1 )
689 {
691 bOk = (aValue >>= mbBackwards);
692 break;
693 case WID_SEARCH_CASE:
694 bOk = (aValue >>= mbCaseSensitive);
695 break;
696 case WID_SEARCH_WORDS:
697 bOk = (aValue >>= mbWords);
698 break;
699 default:
700 throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this));
701 }
702
703 if( !bOk )
704 throw lang::IllegalArgumentException();
705}
706
707uno::Any SAL_CALL SdUnoSearchReplaceDescriptor::getPropertyValue( const OUString& PropertyName )
708{
709 SolarMutexGuard aGuard;
710
711 uno::Any aAny;
712
713 const SfxItemPropertyMapEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName);
714
715 switch( pEntry ? pEntry->nWID : -1 )
716 {
718 aAny <<= mbBackwards;
719 break;
720 case WID_SEARCH_CASE:
721 aAny <<= mbCaseSensitive;
722 break;
723 case WID_SEARCH_WORDS:
724 aAny <<= mbWords;
725 break;
726 default:
727 throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
728 }
729
730 return aAny;
731}
732
733void SAL_CALL SdUnoSearchReplaceDescriptor::addPropertyChangeListener( const OUString& , const css::uno::Reference< css::beans::XPropertyChangeListener >& ) {}
734void SAL_CALL SdUnoSearchReplaceDescriptor::removePropertyChangeListener( const OUString& , const css::uno::Reference< css::beans::XPropertyChangeListener >& ) {}
735void SAL_CALL SdUnoSearchReplaceDescriptor::addVetoableChangeListener( const OUString& , const css::uno::Reference< css::beans::XVetoableChangeListener >& ) {}
736void SAL_CALL SdUnoSearchReplaceDescriptor::removeVetoableChangeListener( const OUString& , const css::uno::Reference< css::beans::XVetoableChangeListener >& ) {}
737
738/* ================================================================= */
739
740SdUnoFindAllAccess::SdUnoFindAllAccess( uno::Sequence< uno::Reference< uno::XInterface > > const & rSequence ) noexcept
741:maSequence( rSequence )
742{
743}
744
746{
747}
748
749// XElementAccess
751{
753}
754
756{
757 return maSequence.hasElements();
758}
759
760// XIndexAccess
762{
763 return maSequence.getLength();
764}
765
767{
769 throw lang::IndexOutOfBoundsException();
770
771 uno::Any aAny;
772 aAny <<= maSequence[Index];
773 return aAny;
774}
775
776/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
FPDF_PAGE mpPage
this class holds a sequence that is a result from a find all and lets people access it through the XI...
Definition: unosrch.hxx:115
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: unosrch.cxx:766
SdUnoFindAllAccess(css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > const &rSequence) noexcept
Definition: unosrch.cxx:740
virtual sal_Bool SAL_CALL hasElements() override
Definition: unosrch.cxx:755
virtual sal_Int32 SAL_CALL getCount() override
Definition: unosrch.cxx:761
virtual ~SdUnoFindAllAccess() noexcept override
Definition: unosrch.cxx:745
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unosrch.cxx:750
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > maSequence
Definition: unosrch.hxx:116
this class holds the parameters and status of a search or replace operation performed by class SdUnoS...
Definition: unosrch.hxx:74
virtual OUString SAL_CALL getReplaceString() override
Definition: unosrch.cxx:663
std::unique_ptr< SvxItemPropertySet > mpPropSet
Definition: unosrch.hxx:75
virtual void SAL_CALL setSearchString(const OUString &aString) override
Definition: unosrch.cxx:657
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosrch.cxx:680
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosrch.cxx:736
SdUnoSearchReplaceDescriptor()
this class holds the parameters and status of a search or replace operation performed by class SdUnoS...
Definition: unosrch.cxx:638
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosrch.cxx:735
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosrch.cxx:674
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosrch.cxx:707
virtual ~SdUnoSearchReplaceDescriptor() noexcept override
Definition: unosrch.cxx:647
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosrch.cxx:733
virtual OUString SAL_CALL getSearchString() override
Definition: unosrch.cxx:652
bool IsCaseSensitive() const
Definition: unosrch.hxx:89
virtual void SAL_CALL setReplaceString(const OUString &aReplaceString) override
Definition: unosrch.cxx:668
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosrch.cxx:734
css::uno::Reference< css::drawing::XShape > GetNextShape(const css::uno::Reference< css::container::XIndexAccess > &xShapes, const css::uno::Reference< css::drawing::XShape > &xCurrentShape) noexcept
this method returns the shape that follows xCurrentShape in the shape collection xShapes.
Definition: unosrch.cxx:349
virtual css::uno::Reference< css::util::XSearchDescriptor > SAL_CALL createSearchDescriptor() override
Definition: unosrch.cxx:182
css::uno::Reference< css::drawing::XShape > GetCurrentShape() const noexcept
Definition: unosrch.cxx:288
static ESelection GetSelection(const css::uno::Reference< css::text::XTextRange > &xTextRange) noexcept
Definition: unosrch.cxx:594
virtual sal_Int32 SAL_CALL replaceAll(const css::uno::Reference< css::util::XSearchDescriptor > &xDesc) override
Definition: unosrch.cxx:107
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL findNext(const css::uno::Reference< css::uno::XInterface > &xStartAt, const css::uno::Reference< css::util::XSearchDescriptor > &xDesc) override
Definition: unosrch.cxx:299
css::drawing::XDrawPage * mpPage
Definition: unosrch.hxx:41
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL findAll(const css::uno::Reference< css::util::XSearchDescriptor > &xDesc) override
Definition: unosrch.cxx:187
static css::uno::Reference< css::drawing::XShape > GetShape(const css::uno::Reference< css::text::XTextRange > &xTextRange) noexcept
Definition: unosrch.cxx:605
css::uno::Reference< css::text::XTextRange > Search(const css::uno::Reference< css::text::XTextRange > &xText, SdUnoSearchReplaceDescriptor *pDescr)
SdUnoSearchReplaceShape(css::drawing::XDrawPage *xPage) noexcept
this class implements a search or replace operation on a given page or a given sdrobj
Definition: unosrch.cxx:92
virtual css::uno::Reference< css::util::XReplaceDescriptor > SAL_CALL createReplaceDescriptor() override
Definition: unosrch.cxx:102
virtual ~SdUnoSearchReplaceShape() noexcept
Definition: unosrch.cxx:97
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL findFirst(const css::uno::Reference< css::util::XSearchDescriptor > &xDesc) override
Definition: unosrch.cxx:279
static SdrItemPool & GetGlobalDrawObjectItemPool()
css::uno::Type const & get()
int nCount
#define DBG_ASSERT(sCon, aError)
float u
Sequence< sal_Int8 > aSeq
int i
sal_Int32 nStartPara
sal_Int32 nStartPos
sal_uInt32 mnIndex
unsigned char sal_Bool
#define UNO_NAME_SEARCH_CASE
Definition: unoprnms.hxx:70
#define UNO_NAME_SEARCH_BACKWARDS
Definition: unoprnms.hxx:69
#define UNO_NAME_SEARCH_WORDS
Definition: unoprnms.hxx:71
static o3tl::span< const SfxItemPropertyMapEntry > ImplGetSearchPropertyMap()
Definition: unosrch.cxx:44
#define WID_SEARCH_WORDS
Definition: unosrch.cxx:42
#define WID_SEARCH_BACKWARDS
Definition: unosrch.cxx:40
#define WID_SEARCH_CASE
Definition: unosrch.cxx:41