LibreOffice Module sd (master) 1
OutlinerIterator.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 <OutlinerIterator.hxx>
22#include <svx/svditer.hxx>
23#include <tools/debug.hxx>
24#include <osl/diagnose.h>
25#include <Outliner.hxx>
26
27#include <drawdoc.hxx>
28#include <DrawViewShell.hxx>
29#include <sdpage.hxx>
30#include <utility>
31
32namespace sd::outliner {
33
34//===== IteratorPosition ======================================================
35
37: mnText(0)
38, mnPageIndex(-1)
39, mePageKind(PageKind::Standard)
40, meEditMode(EditMode::Page)
41{
42}
43
45{
46 return mxObject.get() == aPosition.mxObject.get()
47 && mnText == aPosition.mnText
48 && mnPageIndex == aPosition.mnPageIndex
49 && mePageKind == aPosition.mePageKind
50 && meEditMode == aPosition.meEditMode;
51}
52
53//===== Iterator ==============================================================
54
56{
57}
58
59Iterator::Iterator (const Iterator& rIterator)
60 : mxIterator(rIterator.mxIterator ? rIterator.mxIterator->Clone() : nullptr)
61{
62}
63
64Iterator::Iterator(Iterator&& rIterator) noexcept
65 : mxIterator(std::move(rIterator.mxIterator))
66{
67}
68
69Iterator::Iterator (std::unique_ptr<IteratorImplBase> pObject)
70 : mxIterator(std::move(pObject))
71{
72}
73
75{
76}
77
79{
80 if (this != &rIterator)
81 {
82 if (rIterator.mxIterator)
83 mxIterator.reset(rIterator.mxIterator->Clone());
84 else
85 mxIterator.reset();
86 }
87 return *this;
88}
89
91{
92 mxIterator = std::move(rIterator.mxIterator);
93 return *this;
94}
95
97{
98 DBG_ASSERT (mxIterator, "::sd::outliner::Iterator::operator* : missing implementation object");
99 return mxIterator->GetPosition();
100}
101
103{
104 if (mxIterator)
105 mxIterator->GotoNextText();
106 return *this;
107}
108
109bool Iterator::operator== (const Iterator& rIterator) const
110{
111 if (!mxIterator || !rIterator.mxIterator)
112 return mxIterator.get() == rIterator.mxIterator.get();
113 else
114 return *mxIterator == *rIterator.mxIterator;
115}
116
117bool Iterator::operator!= (const Iterator& rIterator) const
118{
119 return ! operator==(rIterator);
120}
121
123{
124 if (mxIterator)
125 mxIterator->Reverse();
126}
127
128//===== IteratorFactory =======================================================
129
131: mpOutliner(pOutliner)
132{
133}
134
136{
137 return CreateIterator (BEGIN);
138}
139
141{
142 return CreateIterator (END);
143}
144
146{
147 return CreateIterator (CURRENT);
148}
149
151{
152 // Decide on certain features of the outliner which kind of iterator to
153 // use.
155 // There is a selection. Search only in this.
161 aLocation);
162 else
163 // Search in the whole document.
168 aLocation);
169}
170
172 const ::std::vector<::unotools::WeakReference<SdrObject>>& rObjectList,
173 SdDrawDocument* pDocument,
174 const std::shared_ptr<ViewShell>& rpViewShell,
175 bool bDirectionIsForward,
176 IteratorLocation aLocation)
177{
178 OSL_ASSERT(rpViewShell);
179
180 sal_Int32 nObjectIndex;
181
182 if (bDirectionIsForward)
183 switch (aLocation)
184 {
185 case CURRENT:
186 case BEGIN:
187 default:
188 nObjectIndex = 0;
189 break;
190 case END:
191 nObjectIndex = rObjectList.size();
192 break;
193 }
194 else
195 switch (aLocation)
196 {
197 case CURRENT:
198 case BEGIN:
199 default:
200 nObjectIndex = rObjectList.size()-1;
201 break;
202 case END:
203 nObjectIndex = -1;
204 break;
205 }
206
207 return Iterator (std::make_unique<SelectionIteratorImpl> (
208 rObjectList, nObjectIndex, pDocument, rpViewShell, bDirectionIsForward));
209}
210
212 SdDrawDocument* pDocument,
213 const std::shared_ptr<ViewShell>& rpViewShell,
214 bool bDirectionIsForward,
215 IteratorLocation aLocation)
216{
217 OSL_ASSERT(rpViewShell);
218
219 PageKind ePageKind;
220 EditMode eEditMode;
221
222 switch (aLocation)
223 {
224 case BEGIN:
225 default:
226 if (bDirectionIsForward)
227 {
228 ePageKind = PageKind::Standard;
229 eEditMode = EditMode::Page;
230 }
231 else
232 {
233 ePageKind = PageKind::Handout;
234 eEditMode = EditMode::MasterPage;
235 }
236 break;
237
238 case END:
239 if (bDirectionIsForward)
240 {
241 ePageKind = PageKind::Handout;
242 eEditMode = EditMode::MasterPage;
243 }
244 else
245 {
246 ePageKind = PageKind::Standard;
247 eEditMode = EditMode::Page;
248 }
249 break;
250
251 case CURRENT:
252 const std::shared_ptr<DrawViewShell> pDrawViewShell(
253 std::dynamic_pointer_cast<DrawViewShell>(rpViewShell));
254 if (pDrawViewShell)
255 {
256 ePageKind = pDrawViewShell->GetPageKind();
257 eEditMode = pDrawViewShell->GetEditMode();
258 }
259 else
260 {
261 ePageKind = PageKind::Standard;
262 eEditMode = EditMode::Page;
263 }
264 break;
265 }
266
267 sal_Int32 nPageIndex = GetPageIndex (pDocument, rpViewShell,
268 ePageKind, eEditMode, bDirectionIsForward, aLocation);
269
270 return Iterator (
271 std::make_unique<DocumentIteratorImpl> (nPageIndex, ePageKind, eEditMode,
272 pDocument, rpViewShell, bDirectionIsForward));
273}
274
276 SdDrawDocument const * pDocument,
277 const std::shared_ptr<ViewShell>& rpViewShell,
278 PageKind ePageKind,
279 EditMode eEditMode,
280 bool bDirectionIsForward,
281 IteratorLocation aLocation)
282{
283 OSL_ASSERT(rpViewShell);
284
285 sal_Int32 nPageIndex;
286 sal_Int32 nPageCount;
287
288 const std::shared_ptr<DrawViewShell> pDrawViewShell(
289 std::dynamic_pointer_cast<DrawViewShell>(rpViewShell));
290
291 switch (eEditMode)
292 {
293 case EditMode::Page:
294 nPageCount = pDocument->GetSdPageCount (ePageKind);
295 break;
297 nPageCount = pDocument->GetMasterSdPageCount(ePageKind);
298 break;
299 default:
300 nPageCount = 0;
301 }
302
303 switch (aLocation)
304 {
305 case CURRENT:
306 if (pDrawViewShell)
307 nPageIndex = pDrawViewShell->GetCurPagePos();
308 else
309 {
310 const SdPage* pPage = rpViewShell->GetActualPage();
311 if (pPage != nullptr)
312 nPageIndex = (pPage->GetPageNum()-1)/2;
313 else
314 nPageIndex = 0;
315 }
316 break;
317
318 case BEGIN:
319 default:
320 if (bDirectionIsForward)
321 nPageIndex = 0;
322 else
323 nPageIndex = nPageCount-1;
324 break;
325
326 case END:
327 if (bDirectionIsForward)
328 nPageIndex = nPageCount;
329 else
330 nPageIndex = -1;
331 break;
332 }
333
334 return nPageIndex;
335}
336
337//===== IteratorImplBase ====================================================
338
340 const std::weak_ptr<ViewShell>& rpViewShellWeak,
341 bool bDirectionIsForward)
342: mpDocument (pDocument)
343, mpViewShellWeak (rpViewShellWeak)
344, mbDirectionIsForward (bDirectionIsForward)
345{
346 std::shared_ptr<DrawViewShell> pDrawViewShell;
347 if ( ! mpViewShellWeak.expired())
348 pDrawViewShell = std::dynamic_pointer_cast<DrawViewShell>(rpViewShellWeak.lock());
349
350 if (pDrawViewShell)
351 {
352 maPosition.mePageKind = pDrawViewShell->GetPageKind();
353 maPosition.meEditMode = pDrawViewShell->GetEditMode();
354 }
355 else
356 {
359 }
360}
361
363 std::weak_ptr<ViewShell> pViewShellWeak,
364 bool bDirectionIsForward, PageKind ePageKind, EditMode eEditMode)
365: mpDocument (pDocument)
366, mpViewShellWeak (std::move(pViewShellWeak))
367, mbDirectionIsForward (bDirectionIsForward)
368{
369 maPosition.mePageKind = ePageKind;
370 maPosition.meEditMode = eEditMode;
371}
372
374{}
375
377{
378 return maPosition == rIterator.maPosition;
379}
380
382{
383 // When this method is executed instead of the ones from derived classes
384 // then the argument is of another type then the object itself. In this
385 // just compare the position objects.
386 return maPosition == rIterator.maPosition;
387}
388
390{
391 return maPosition;
392}
393
395{
396 if (pObject != nullptr)
397 {
398 pObject->maPosition = maPosition;
399 pObject->mpDocument = mpDocument;
400 pObject->mpViewShellWeak = mpViewShellWeak;
401 pObject->mbDirectionIsForward = mbDirectionIsForward;
402 }
403 return pObject;
404}
405
407{
409}
410
411//===== SelectionIteratorImpl ===========================================
412
414 const ::std::vector<::unotools::WeakReference<SdrObject>>& rObjectList,
415 sal_Int32 nObjectIndex,
416 SdDrawDocument* pDocument,
417 const std::weak_ptr<ViewShell>& rpViewShellWeak,
418 bool bDirectionIsForward)
419 : IteratorImplBase (pDocument, rpViewShellWeak, bDirectionIsForward),
420 mrObjectList(rObjectList),
421 mnObjectIndex(nObjectIndex)
422{
423}
424
426{}
427
429{
430 SelectionIteratorImpl* pIterator = static_cast<SelectionIteratorImpl*>(pObject);
431 if (pIterator == nullptr)
432 pIterator = new SelectionIteratorImpl (
434 return pIterator;
435}
436
438{
439 SdrTextObj* pTextObj = DynCastSdrTextObj( mrObjectList.at(mnObjectIndex).get().get() );
441 {
442 if( pTextObj )
443 {
445 if( maPosition.mnText >= pTextObj->getTextCount() )
446 {
447 maPosition.mnText = 0;
449 }
450 }
451 else
452 {
454 }
455 }
456 else
457 {
458 if( pTextObj )
459 {
461 if( maPosition.mnText < 0 )
462 {
463 maPosition.mnText = -1;
465 }
466 }
467 else
468 {
470 maPosition.mnText = -1;
471 }
472
473 if( (maPosition.mnText == -1) && (mnObjectIndex >= 0) )
474 {
475 pTextObj = DynCastSdrTextObj( mrObjectList.at(mnObjectIndex).get().get() );
476 if( pTextObj )
477 maPosition.mnText = pTextObj->getTextCount() - 1;
478 }
479
480 if( maPosition.mnText == -1 )
481 maPosition.mnText = 0;
482 }
483}
484
486{
488
489 return maPosition;
490}
491
493{
494 return rIterator.IsEqualSelection(*this);
495}
496
498{
499 const SelectionIteratorImpl* pSelectionIterator =
500 static_cast<const SelectionIteratorImpl*>(&rIterator);
501 return mpDocument == pSelectionIterator->mpDocument
502 && mnObjectIndex == pSelectionIterator->mnObjectIndex;
503}
504
505//===== ViewIteratorImpl ================================================
506
508 sal_Int32 nPageIndex,
509 SdDrawDocument* pDocument,
510 const std::weak_ptr<ViewShell>& rpViewShellWeak,
511 bool bDirectionIsForward)
512 : IteratorImplBase (pDocument, rpViewShellWeak, bDirectionIsForward),
513 mbPageChangeOccurred(false),
514 mpPage(nullptr)
515{
516 SetPage (nPageIndex);
517}
518
520 sal_Int32 nPageIndex,
521 SdDrawDocument* pDocument,
522 const std::weak_ptr<ViewShell>& rpViewShellWeak,
523 bool bDirectionIsForward,
524 PageKind ePageKind,
525 EditMode eEditMode)
526 : IteratorImplBase (pDocument, rpViewShellWeak, bDirectionIsForward, ePageKind, eEditMode),
527 mbPageChangeOccurred(false),
528 mpPage(nullptr)
529{
530 SetPage (nPageIndex);
531}
532
534{
535}
536
538{
539
540 ViewIteratorImpl* pIterator = static_cast<ViewIteratorImpl*>(pObject);
541 if (pIterator == nullptr)
542 pIterator = new ViewIteratorImpl (
544
546
548 {
549 pIterator->moObjectIterator.emplace(mpPage, SdrIterMode::DeepNoGroups, !mbDirectionIsForward);
550
551 // No direct way to set the object iterator to the current object.
552 pIterator->maPosition.mxObject = nullptr;
553 while (pIterator->moObjectIterator->IsMore() && pIterator->maPosition.mxObject.get()!=maPosition.mxObject.get())
554 pIterator->maPosition.mxObject = pIterator->moObjectIterator->Next();
555 }
556 else
557 pIterator->moObjectIterator.reset();
558
559 return pIterator;
560}
561
563{
564 SdrTextObj* pTextObj = DynCastSdrTextObj( maPosition.mxObject.get().get() );
565 if( pTextObj )
566 {
568 {
570 if( maPosition.mnText < pTextObj->getTextCount() )
571 return;
572 }
573 else
574 {
576 if( maPosition.mnText >= 0 )
577 return;
578 }
579 }
580
581 if (moObjectIterator && moObjectIterator->IsMore())
583 else
584 maPosition.mxObject = nullptr;
585
586 if (!maPosition.mxObject.get().is() )
587 {
590 else
592
593 if (mpPage != nullptr)
594 moObjectIterator.emplace( mpPage, SdrIterMode::DeepNoGroups, !mbDirectionIsForward );
595 if (moObjectIterator && moObjectIterator->IsMore())
597 else
598 maPosition.mxObject = nullptr;
599 }
600
601 maPosition.mnText = 0;
603 {
604 pTextObj = DynCastSdrTextObj( maPosition.mxObject.get().get() );
605 if( pTextObj )
606 maPosition.mnText = pTextObj->getTextCount() - 1;
607 }
608}
609
610void ViewIteratorImpl::SetPage (sal_Int32 nPageIndex)
611{
614 {
615 maPosition.mnPageIndex = nPageIndex;
616
617 sal_Int32 nPageCount;
620 else
621 nPageCount = mpDocument->GetMasterSdPageCount(
623
624 // Get page pointer. Here we have three cases: regular pages,
625 // master pages and invalid page indices. The later ones are not
626 // errors but the effect of the iterator advancing to the next page
627 // and going past the last one. This dropping of the rim at the far
628 // side is detected here and has to be reacted to by the caller.
629 if (nPageIndex>=0 && nPageIndex < nPageCount)
630 {
633 static_cast<sal_uInt16>(nPageIndex),
635 else
637 static_cast<sal_uInt16>(nPageIndex),
639 }
640 else
641 mpPage = nullptr;
642 }
643
644 // Set up object list iterator.
645 if (mpPage != nullptr)
646 moObjectIterator.emplace(mpPage, SdrIterMode::DeepNoGroups, ! mbDirectionIsForward);
647 else
648 moObjectIterator.reset();
649
650 // Get object pointer.
651 if (moObjectIterator && moObjectIterator->IsMore())
653 else
654 maPosition.mxObject = nullptr;
655
656 maPosition.mnText = 0;
658 {
659 SdrTextObj* pTextObj = DynCastSdrTextObj( maPosition.mxObject.get().get() );
660 if( pTextObj )
661 maPosition.mnText = pTextObj->getTextCount() - 1;
662 }
663
664}
665
667{
669
670 // Create reversed object list iterator.
671 if (mpPage != nullptr)
672 moObjectIterator.emplace(mpPage, SdrIterMode::DeepNoGroups, ! mbDirectionIsForward);
673 else
674 moObjectIterator.reset();
675
676 // Move iterator to the current object.
678 maPosition.mxObject = nullptr;
679
680 if (!moObjectIterator)
681 return;
682
683 while (moObjectIterator->IsMore() && maPosition.mxObject.get() != xObject.get())
685}
686
687//===== DocumentIteratorImpl ============================================
688
690 sal_Int32 nPageIndex,
691 PageKind ePageKind, EditMode eEditMode,
692 SdDrawDocument* pDocument,
693 const std::weak_ptr<ViewShell>& rpViewShellWeak,
694 bool bDirectionIsForward)
695 : ViewIteratorImpl (nPageIndex, pDocument, rpViewShellWeak, bDirectionIsForward,
696 ePageKind, eEditMode)
697{
698 if (eEditMode == EditMode::Page)
699 mnPageCount = pDocument->GetSdPageCount (ePageKind);
700 else
701 mnPageCount = pDocument->GetMasterSdPageCount(ePageKind);
702}
703
705{}
706
708{
709 DocumentIteratorImpl* pIterator = static_cast<DocumentIteratorImpl*>(pObject);
710 if (pIterator == nullptr)
711 pIterator = new DocumentIteratorImpl (
714 // Finish the cloning.
715 return ViewIteratorImpl::Clone (pIterator);
716}
717
719{
720 bool bSetToOnePastLastPage = false;
721 bool bViewChanged = false;
722
724
726 {
728 {
729 // Switch to master page.
731 {
733 SetPage (0);
734 }
735
736 // Switch to next view mode.
737 else
738 {
740 // Not really necessary but makes things more clear.
741 bSetToOnePastLastPage = true;
742 else
743 {
749 SetPage (0);
750 }
751 }
752 bViewChanged = true;
753 }
754 }
755 else
756 if (maPosition.mnPageIndex < 0)
757 {
758 // Switch from master pages to draw pages.
760 {
762 bSetToOnePastLastPage = true;
763 }
764
765 // Switch to previous view mode.
766 else
767 {
769 SetPage (-1);
770 else
771 {
777 bSetToOnePastLastPage = true;
778 }
779 }
780 bViewChanged = true;
781 }
782
783 if (!bViewChanged)
784 return;
785
786 // Get new page count;
787 sal_Int32 nPageCount;
790 else
792
793 // Now that we know the number of pages we can set the current page index.
794 if (bSetToOnePastLastPage)
795 SetPage (nPageCount);
796}
797
798} // end of namespace ::sd::outliner
799
800/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FPDF_PAGE mpPage
Page
sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:222
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
Definition: drawdoc2.cxx:207
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
Definition: drawdoc2.cxx:217
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:212
The main purpose of this class is searching and replacing as well as spelling of impress documents.
Definition: Outliner.hxx:123
::std::vector< unotools::WeakReference< SdrObject > > maMarkListCopy
When the search is restricted to the current selection then this list contains pointers to all the ob...
Definition: Outliner.hxx:275
bool mbRestrictSearchToSelection
This flag indicates that only the selected objects are to be searched.
Definition: Outliner.hxx:268
std::weak_ptr<::sd::ViewShell > mpWeakViewShell
The view shell containing the view.
Definition: Outliner.hxx:220
bool mbDirectionIsForward
This flag indicates whether to search forward or backwards.
Definition: Outliner.hxx:263
SdDrawDocument * mpDrawDocument
The document on whose objects and pages this class operates.
Definition: Outliner.hxx:224
sal_uInt16 GetPageNum() const
virtual sal_Int32 getTextCount() const override
Iterator for iteration over all objects in all views.
sal_Int32 mnPageCount
Number of pages in the view that is specified by <member>maPosition</member>.
DocumentIteratorImpl(sal_Int32 nPageIndex, PageKind ePageKind, EditMode eEditMode, SdDrawDocument *pDocument, const std::weak_ptr< ViewShell > &rpViewShellWeak, bool bDirectionIsForward)
virtual IteratorImplBase * Clone(IteratorImplBase *pObject=nullptr) const override
Create an exact copy of this object.
virtual void GotoNextText() override
Advance to the next text of the current object or to the next object.
Base class for the polymorphic implementation class of the <type>Iterator</type> class.
IteratorImplBase(SdDrawDocument *pDocument, const std::weak_ptr< ViewShell > &rpViewShellWeak, bool bDirectionIsForward)
The constructor stores the given arguments to be used by the derived classes.
SdDrawDocument * mpDocument
The document on whose data the iterator operates.
virtual bool IsEqualSelection(const IteratorImplBase &rIterator) const
This method is used by the equality operator.
bool mbDirectionIsForward
Specifies the search direction.
virtual IteratorImplBase * Clone(IteratorImplBase *pObject=nullptr) const
Create an exact copy of this object.
virtual bool operator==(const IteratorImplBase &rIterator) const
Test the equality of the this object and the given iterator.
std::weak_ptr< ViewShell > mpViewShellWeak
Necessary secondary source of information.
IteratorPosition maPosition
The current position as returned by <member>GetPosition()</member>.
virtual const IteratorPosition & GetPosition()
Return an object that describes the current object.
virtual void Reverse()
Reverse the direction of iteration.
Data collection specifying a <type>SdrObject</type> and its position in a document and view.
bool operator==(const IteratorPosition &aPosition) const
Compare two positions for equality.
PageKind mePageKind
Page kind of the view.
EditMode meEditMode
Edit mode of the view.
IteratorPosition()
Create a new object with all data members set to default values.
sal_Int32 mnPageIndex
The index of a page where the object is located on.
sal_Int32 mnText
Number of the actual SdrText from the current <type>SdrObject</type>
::unotools::WeakReference< SdrObject > mxObject
Pointer to the actual <type>SdrObject</type> object.
This iterator can be used to iterate over all <type>SdrObject</type> objects of one of three set deno...
void Reverse()
Reverse the direction of iteration.
const IteratorPosition & operator*() const
Return the current position of the iterator.
Iterator & operator++()
The prefix increment operator returns the iterator pointing to the next object.
Iterator & operator=(const Iterator &rIterator)
Assign the iterator from the given one.
bool operator==(const Iterator &rIterator) const
Test equality of two iterators.
std::unique_ptr< IteratorImplBase > mxIterator
The implementation object to which most of the methods are forwarded.
bool operator!=(const Iterator &rIterator) const
Test whether two iterators point to different objects.
Iterator current()
Return an iterator that points to the current object of one of the sets described above.
OutlinerContainer(SdOutliner *pOutliner)
Create a new wrapper object for the given outliner.
static sal_Int32 GetPageIndex(SdDrawDocument const *pDocument, const std::shared_ptr< ViewShell > &rpViewShell, PageKind ePageKind, EditMode eEditMode, bool bDirectionIsForward, IteratorLocation aLocation)
Return the index of a page that contains an object that a new iterator shall point to.
Iterator begin()
Return an iterator that points to the first object of one of the sets described above.
Iterator CreateIterator(IteratorLocation aLocation)
Create an iterator.
Iterator end()
Return an iterator that marks the end of the iteration.
static Iterator CreateSelectionIterator(const ::std::vector<::unotools::WeakReference< SdrObject > > &rObjectList, SdDrawDocument *pDocument, const std::shared_ptr< ViewShell > &rpViewShell, bool bDirectionIsForward, IteratorLocation aLocation)
Create an iterator that iterates over all currently selected <type>SdrObjects</type> objects of the <...
static Iterator CreateDocumentIterator(SdDrawDocument *pDocument, const std::shared_ptr< ViewShell > &rpViewShell, bool bDirectionIsForward, IteratorLocation aLocation)
Create an iterator that iterates over all <type>SdrObjects</type> objects of the <member>mpOutliner</...
SdOutliner * mpOutliner
The wrapped outliner that is represented as object container.
Iterator all objects that belong to the current mark list a.k.a.
SelectionIteratorImpl(const ::std::vector< ::unotools::WeakReference< SdrObject > > &rObjectList, sal_Int32 nObjectIndex, SdDrawDocument *pDocument, const std::weak_ptr< ViewShell > &rpViewShellWeak, bool bDirectionIsForward)
virtual bool IsEqualSelection(const IteratorImplBase &rIterator) const override
Compare the given iterator with this object.
virtual IteratorImplBase * Clone(IteratorImplBase *pObject=nullptr) const override
Create an exact copy of this object.
virtual bool operator==(const IteratorImplBase &rIterator) const override
Test the equality of the this object and the given iterator.
virtual void GotoNextText() override
Advance to the next text of the current object or to the next object.
virtual const IteratorPosition & GetPosition() override
Return an object that describes the current object.
const ::std::vector<::unotools::WeakReference< SdrObject > > & mrObjectList
Iterator for iteration over all objects in a single view.
bool mbPageChangeOccurred
Indicates whether a page changed occurred on switching to current page.
std::optional< SdrObjListIter > moObjectIterator
Iterator of all objects on the current page.
void SetPage(sal_Int32 nPageIndex)
Set up page pointer and object list iterator for the specified page.
virtual IteratorImplBase * Clone(IteratorImplBase *pObject=nullptr) const override
Create an exact copy of this object.
SdPage * mpPage
Pointer to the page associated with the current page index. May be NULL.
virtual void GotoNextText() override
Advance to the next text of the current object or to the next object.
virtual void Reverse() override
Reverse the direction of iteration.
ViewIteratorImpl(sal_Int32 nPageIndex, SdDrawDocument *pDocument, const std::weak_ptr< ViewShell > &rpViewShellWeak, bool bDirectionIsForward)
rtl::Reference< interface_type > SAL_CALL get() const
#define DBG_ASSERT(sCon, aError)
EmbeddedObjectRef * pObject
IteratorLocation
Use this enum to specify the initial location of the object pointed to by a newly created iterator.
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
EditMode
Definition: pres.hxx:53
PageKind
Definition: pres.hxx:45
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)