1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include "olinetab.hxx"
24 #include "rechead.hxx"
25 #include "address.hxx"
28 #include <osl/diagnose.h>
30 ScOutlineEntry::ScOutlineEntry( SCCOLROW nNewStart
, SCCOLROW nNewSize
, bool bNewHidden
) :
33 bHidden ( bNewHidden
),
38 ScOutlineEntry::ScOutlineEntry( const ScOutlineEntry
& rEntry
) :
39 nStart ( rEntry
.nStart
),
40 nSize ( rEntry
.nSize
),
41 bHidden ( rEntry
.bHidden
),
42 bVisible( rEntry
.bVisible
)
46 SCCOLROW
ScOutlineEntry::GetEnd() const
48 return nStart
+nSize
-1;
51 void ScOutlineEntry::Move( SCsCOLROW nDelta
)
53 SCCOLROW nNewPos
= nStart
+ nDelta
;
56 OSL_FAIL("OutlineEntry < 0");
62 void ScOutlineEntry::SetSize( SCSIZE nNewSize
)
68 OSL_FAIL("ScOutlineEntry Size == 0");
72 void ScOutlineEntry::SetPosSize( SCCOLROW nNewPos
, SCSIZE nNewSize
)
78 void ScOutlineEntry::SetHidden( bool bNewHidden
)
83 void ScOutlineEntry::SetVisible( bool bNewVisible
)
85 bVisible
= bNewVisible
;
88 ScOutlineCollection::ScOutlineCollection() {}
90 size_t ScOutlineCollection::size() const
92 return maEntries
.size();
95 void ScOutlineCollection::clear()
100 void ScOutlineCollection::insert(ScOutlineEntry
* pEntry
)
102 SCCOLROW nStart
= pEntry
->GetStart();
103 maEntries
.insert(nStart
, pEntry
);
106 ScOutlineCollection::iterator
ScOutlineCollection::begin()
108 return maEntries
.begin();
111 ScOutlineCollection::iterator
ScOutlineCollection::end()
113 return maEntries
.end();
116 ScOutlineCollection::const_iterator
ScOutlineCollection::begin() const
118 return maEntries
.begin();
121 ScOutlineCollection::const_iterator
ScOutlineCollection::end() const
123 return maEntries
.end();
126 void ScOutlineCollection::erase(iterator pos
)
128 maEntries
.erase(pos
);
131 bool ScOutlineCollection::empty() const
133 return maEntries
.empty();
136 ScOutlineCollection::iterator
ScOutlineCollection::FindStart(SCCOLROW nMinStart
)
138 return maEntries
.lower_bound(nMinStart
);
141 ScOutlineArray::ScOutlineArray() :
144 ScOutlineArray::ScOutlineArray( const ScOutlineArray
& rArray
) :
145 nDepth( rArray
.nDepth
)
147 for (size_t nLevel
= 0; nLevel
< nDepth
; ++nLevel
)
149 const ScOutlineCollection
& rColl
= rArray
.aCollections
[nLevel
];
150 ScOutlineCollection::const_iterator it
= rColl
.begin(), itEnd
= rColl
.end();
151 for (; it
!= itEnd
; ++it
)
153 const ScOutlineEntry
* pEntry
= it
->second
;
154 aCollections
[nLevel
].insert(new ScOutlineEntry(*pEntry
));
159 void ScOutlineArray::FindEntry(
160 SCCOLROW nSearchPos
, size_t& rFindLevel
, size_t& rFindIndex
,
163 rFindLevel
= rFindIndex
= 0;
165 if (nMaxLevel
> nDepth
)
168 for (size_t nLevel
= 0; nLevel
< nMaxLevel
; ++nLevel
) //TODO: Search backwards?
170 ScOutlineCollection
* pCollect
= &aCollections
[nLevel
];
171 ScOutlineCollection::iterator it
= pCollect
->begin(), itEnd
= pCollect
->end();
172 for (; it
!= itEnd
; ++it
)
174 ScOutlineEntry
* pEntry
= it
->second
;
175 if (pEntry
->GetStart() <= nSearchPos
&& pEntry
->GetEnd() >= nSearchPos
)
177 rFindLevel
= nLevel
+ 1; // Next Level (for insertion)
178 rFindIndex
= std::distance(pCollect
->begin(), it
);
184 bool ScOutlineArray::Insert(
185 SCCOLROW nStartCol
, SCCOLROW nEndCol
, bool& rSizeChanged
, bool bHidden
, bool bVisible
)
187 rSizeChanged
= false;
189 size_t nStartLevel
, nEndLevel
, nStartIndex
, nEndIndex
;
194 FindEntry( nStartCol
, nStartLevel
, nStartIndex
); // nLevel = new Level (old+1)
195 FindEntry( nEndCol
, nEndLevel
, nEndIndex
);
196 nFindMax
= std::max(nStartLevel
,nEndLevel
);
201 if (nStartLevel
== nEndLevel
&& nStartIndex
== nEndIndex
&& nStartLevel
< SC_OL_MAXDEPTH
)
211 ScOutlineCollection::const_iterator it
= aCollections
[nStartLevel
-1].begin();
212 std::advance(it
, nStartIndex
);
213 if (it
->second
->GetStart() == nStartCol
)
214 FindEntry(nStartCol
, nStartLevel
, nStartIndex
, nFindMax
);
219 ScOutlineCollection::const_iterator it
= aCollections
[nEndLevel
-1].begin();
220 std::advance(it
, nEndIndex
);
221 if (it
->second
->GetEnd() == nEndCol
)
222 FindEntry(nEndCol
, nEndLevel
, nEndIndex
, nFindMax
);
228 while ( !bFound
&& bCont
);
233 size_t nLevel
= nStartLevel
;
235 // Move the ones underneath
236 bool bNeedSize
= false;
239 for (size_t nMoveLevel
= nDepth
-1; nMoveLevel
>= nLevel
; --nMoveLevel
)
241 ScOutlineCollection
& rColl
= aCollections
[nMoveLevel
];
242 ScOutlineCollection::iterator it
= rColl
.begin(), itEnd
= rColl
.end();
245 ScOutlineEntry
* pEntry
= it
->second
;
246 SCCOLROW nEntryStart
= pEntry
->GetStart();
247 if (nEntryStart
>= nStartCol
&& nEntryStart
<= nEndCol
)
249 if (nMoveLevel
>= SC_OL_MAXDEPTH
- 1)
251 rSizeChanged
= false; // No more room
254 aCollections
[nMoveLevel
+1].insert(new ScOutlineEntry(*pEntry
));
255 size_t nPos
= std::distance(rColl
.begin(), it
);
258 std::advance(it
, nPos
);
260 if (nMoveLevel
== nDepth
- 1)
277 if (nDepth
<= nLevel
)
283 ScOutlineEntry
* pNewEntry
= new ScOutlineEntry( nStartCol
, nEndCol
+1-nStartCol
, bHidden
);
284 pNewEntry
->SetVisible( bVisible
);
285 aCollections
[nLevel
].insert(pNewEntry
);
290 bool ScOutlineArray::FindTouchedLevel(
291 SCCOLROW nBlockStart
, SCCOLROW nBlockEnd
, size_t& rFindLevel
) const
296 for (size_t nLevel
= 0; nLevel
< nDepth
; ++nLevel
)
298 const ScOutlineCollection
* pCollect
= &aCollections
[nLevel
];
299 ScOutlineCollection::const_iterator it
= pCollect
->begin(), itEnd
= pCollect
->end();
300 for (; it
!= itEnd
; ++it
)
302 const ScOutlineEntry
* pEntry
= it
->second
;
303 SCCOLROW nStart
= pEntry
->GetStart();
304 SCCOLROW nEnd
= pEntry
->GetEnd();
306 if ( ( nBlockStart
>=nStart
&& nBlockStart
<=nEnd
) ||
307 ( nBlockEnd
>=nStart
&& nBlockEnd
<=nEnd
) )
309 rFindLevel
= nLevel
; // Actual Level
318 void ScOutlineArray::RemoveSub(SCCOLROW nStartPos
, SCCOLROW nEndPos
, size_t nLevel
)
320 if ( nLevel
>= nDepth
)
323 ScOutlineCollection
& rColl
= aCollections
[nLevel
];
325 ScOutlineCollection::iterator it
= rColl
.begin(), itEnd
= rColl
.end();
328 ScOutlineEntry
* pEntry
= it
->second
;
329 SCCOLROW nStart
= pEntry
->GetStart();
330 SCCOLROW nEnd
= pEntry
->GetEnd();
331 if (nStart
>= nStartPos
&& nEnd
<= nEndPos
)
334 RemoveSub( nStart
, nEnd
, nLevel
+1 );
336 // Re-calc iterator positions after the tree gets invalidated
337 size_t nPos
= std::distance(rColl
.begin(), it
);
340 std::advance(it
, nPos
);
352 ScOutlineEntry
* pEntry
= it
->second
;
353 SCCOLROW nStart
= pEntry
->GetStart();
354 SCCOLROW nEnd
= pEntry
->GetEnd();
356 if (nStart
>= nStartPos
&& nEnd
<= nEndPos
)
358 RemoveSub( nStart
, nEnd
, nLevel
+1 );
360 // Re-calc iterator positions after the tree gets invalidated
361 size_t nPos
= std::distance(rColl
.begin(), it
);
364 std::advance(it
, nPos
);
372 void ScOutlineArray::PromoteSub(SCCOLROW nStartPos
, SCCOLROW nEndPos
, size_t nStartLevel
)
376 OSL_FAIL("PromoteSub with Level 0");
380 for (size_t nLevel
= nStartLevel
; nLevel
< nDepth
; ++nLevel
)
382 ScOutlineCollection
& rColl
= aCollections
[nLevel
];
383 ScOutlineCollection::iterator it
= rColl
.begin(), itEnd
= rColl
.end();
386 ScOutlineEntry
* pEntry
= it
->second
;
387 SCCOLROW nStart
= pEntry
->GetStart();
388 SCCOLROW nEnd
= pEntry
->GetEnd();
389 if (nStart
>= nStartPos
&& nEnd
<= nEndPos
)
391 aCollections
[nLevel
-1].insert(new ScOutlineEntry(*pEntry
));
393 // Re-calc iterator positions after the tree gets invalidated
394 size_t nPos
= std::distance(rColl
.begin(), it
);
397 std::advance(it
, nPos
);
409 ScOutlineEntry
* pEntry
= it
->second
;
410 SCCOLROW nStart
= pEntry
->GetStart();
411 SCCOLROW nEnd
= pEntry
->GetEnd();
412 if (nStart
>= nStartPos
&& nEnd
<= nEndPos
)
414 aCollections
[nLevel
-1].insert(new ScOutlineEntry(*pEntry
));
416 // Re-calc iterator positions after the tree gets invalidated
417 size_t nPos
= std::distance(rColl
.begin(), it
);
420 std::advance(it
, nPos
);
430 * Adapt nDepth for empty Levels
432 bool ScOutlineArray::DecDepth()
434 bool bChanged
= false;
441 if (aCollections
[nDepth
-1].empty())
454 bool ScOutlineArray::Remove( SCCOLROW nBlockStart
, SCCOLROW nBlockEnd
, bool& rSizeChanged
)
457 FindTouchedLevel( nBlockStart
, nBlockEnd
, nLevel
);
459 ScOutlineCollection
* pCollect
= &aCollections
[nLevel
];
460 ScOutlineCollection::iterator it
= pCollect
->begin(), itEnd
= pCollect
->end();
464 ScOutlineEntry
* pEntry
= it
->second
;
465 SCCOLROW nStart
= pEntry
->GetStart();
466 SCCOLROW nEnd
= pEntry
->GetEnd();
467 if (nBlockStart
<= nEnd
&& nBlockEnd
>= nStart
)
471 PromoteSub( nStart
, nEnd
, nLevel
+1 );
472 itEnd
= pCollect
->end();
473 it
= pCollect
->FindStart( nEnd
+1 );
480 if (bAny
) // Adapt Depth
487 ScOutlineEntry
* ScOutlineArray::GetEntry(size_t nLevel
, size_t nIndex
)
489 if (nLevel
>= nDepth
)
492 ScOutlineCollection
& rColl
= aCollections
[nLevel
];
493 if (nIndex
>= rColl
.size())
496 ScOutlineCollection::iterator it
= rColl
.begin();
497 std::advance(it
, nIndex
);
501 const ScOutlineEntry
* ScOutlineArray::GetEntry(size_t nLevel
, size_t nIndex
) const
503 if (nLevel
>= nDepth
)
506 const ScOutlineCollection
& rColl
= aCollections
[nLevel
];
507 if (nIndex
>= rColl
.size())
510 ScOutlineCollection::const_iterator it
= rColl
.begin();
511 std::advance(it
, nIndex
);
515 size_t ScOutlineArray::GetCount(size_t nLevel
) const
517 if (nLevel
>= nDepth
)
520 return aCollections
[nLevel
].size();
523 const ScOutlineEntry
* ScOutlineArray::GetEntryByPos(size_t nLevel
, SCCOLROW nPos
) const
525 if (nLevel
>= nDepth
)
528 const ScOutlineCollection
& rColl
= aCollections
[nLevel
];
529 ScOutlineCollection::const_iterator it
= rColl
.begin(), itEnd
= rColl
.end();
530 for (; it
!= itEnd
; ++it
)
532 const ScOutlineEntry
* pEntry
= it
->second
;
533 if (pEntry
->GetStart() <= nPos
&& nPos
<= pEntry
->GetEnd())
540 bool ScOutlineArray::GetEntryIndex(size_t nLevel
, SCCOLROW nPos
, size_t& rnIndex
) const
542 if (nLevel
>= nDepth
)
545 // Found entry contains passed position
546 const ScOutlineCollection
& rColl
= aCollections
[nLevel
];
547 ScOutlineCollection::const_iterator it
= rColl
.begin(), itEnd
= rColl
.end();
548 for (; it
!= itEnd
; ++it
)
550 const ScOutlineEntry
* p
= it
->second
;
551 if (p
->GetStart() <= nPos
&& nPos
<= p
->GetEnd())
553 rnIndex
= std::distance(rColl
.begin(), it
);
560 bool ScOutlineArray::GetEntryIndexInRange(
561 size_t nLevel
, SCCOLROW nBlockStart
, SCCOLROW nBlockEnd
, size_t& rnIndex
) const
563 if (nLevel
>= nDepth
)
566 // Found entry will be completely inside of passed range
567 const ScOutlineCollection
& rColl
= aCollections
[nLevel
];
568 ScOutlineCollection::const_iterator it
= rColl
.begin(), itEnd
= rColl
.end();
569 for (; it
!= itEnd
; ++it
)
571 const ScOutlineEntry
* p
= it
->second
;
572 if (nBlockStart
<= p
->GetStart() && p
->GetEnd() <= nBlockEnd
)
574 rnIndex
= std::distance(rColl
.begin(), it
);
581 void ScOutlineArray::SetVisibleBelow(
582 size_t nLevel
, size_t nEntry
, bool bValue
, bool bSkipHidden
)
584 const ScOutlineEntry
* pEntry
= GetEntry( nLevel
, nEntry
);
588 SCCOLROW nStart
= pEntry
->GetStart();
589 SCCOLROW nEnd
= pEntry
->GetEnd();
591 for (size_t nSubLevel
= nLevel
+1; nSubLevel
< nDepth
; ++nSubLevel
)
593 ScOutlineCollection
& rColl
= aCollections
[nSubLevel
];
594 ScOutlineCollection::iterator it
= rColl
.begin(), itEnd
= rColl
.end();
595 for (; it
!= itEnd
; ++it
)
597 ScOutlineEntry
* p
= it
->second
;
598 if (p
->GetStart() >= nStart
&& p
->GetEnd() <= nEnd
)
600 p
->SetVisible(bValue
);
601 if (bSkipHidden
&& !p
->IsHidden())
603 size_t nPos
= std::distance(rColl
.begin(), it
);
604 SetVisibleBelow(nSubLevel
, nPos
, bValue
, true);
610 nSubLevel
= nDepth
; // Bail out
614 void ScOutlineArray::GetRange(SCCOLROW
& rStart
, SCCOLROW
& rEnd
) const
616 const ScOutlineCollection
& rColl
= aCollections
[0];
619 ScOutlineCollection::const_iterator it
= rColl
.begin();
620 rStart
= it
->second
->GetStart();
621 std::advance(it
, rColl
.size()-1);
622 rEnd
= it
->second
->GetEnd();
628 void ScOutlineArray::ExtendBlock(size_t nLevel
, SCCOLROW
& rBlkStart
, SCCOLROW
& rBlkEnd
)
630 if (nLevel
>= nDepth
)
633 const ScOutlineCollection
& rColl
= aCollections
[nLevel
];
634 ScOutlineCollection::const_iterator it
= rColl
.begin(), itEnd
= rColl
.end();
635 for (; it
!= itEnd
; ++it
)
637 const ScOutlineEntry
* pEntry
= it
->second
;
638 SCCOLROW nStart
= pEntry
->GetStart();
639 SCCOLROW nEnd
= pEntry
->GetEnd();
641 if (rBlkStart
<= nEnd
&& rBlkEnd
>= nStart
)
643 if (nStart
< rBlkStart
)
651 bool ScOutlineArray::TestInsertSpace(SCSIZE nSize
, SCCOLROW nMaxVal
) const
653 const ScOutlineCollection
& rColl
= aCollections
[0];
657 ScOutlineCollection::const_iterator it
= rColl
.begin();
658 std::advance(it
, rColl
.size()-1);
659 SCCOLROW nEnd
= it
->second
->GetEnd();
660 return sal::static_int_cast
<SCCOLROW
>(nEnd
+nSize
) <= nMaxVal
;
663 void ScOutlineArray::InsertSpace(SCCOLROW nStartPos
, SCSIZE nSize
)
665 ScSubOutlineIterator
aIter( this );
666 ScOutlineEntry
* pEntry
;
667 while ((pEntry
= aIter
.GetNext()) != NULL
)
669 if ( pEntry
->GetStart() >= nStartPos
)
670 pEntry
->Move(static_cast<SCsCOLROW
>(nSize
));
673 SCCOLROW nEnd
= pEntry
->GetEnd();
674 // Always expand if inserted within the group
675 // When inserting at the end, only if the group is not hidden
676 if ( nEnd
>= nStartPos
|| ( nEnd
+1 >= nStartPos
&& !pEntry
->IsHidden() ) )
678 SCSIZE nEntrySize
= pEntry
->GetSize();
680 pEntry
->SetSize( nEntrySize
);
686 bool ScOutlineArray::DeleteSpace(SCCOLROW nStartPos
, SCSIZE nSize
)
688 SCCOLROW nEndPos
= nStartPos
+ nSize
- 1;
689 bool bNeedSave
= false; // Do we need the original one for Undo?
690 bool bChanged
= false; // For Level test
692 ScSubOutlineIterator
aIter( this );
693 ScOutlineEntry
* pEntry
;
694 while((pEntry
=aIter
.GetNext())!=NULL
)
696 SCCOLROW nEntryStart
= pEntry
->GetStart();
697 SCCOLROW nEntryEnd
= pEntry
->GetEnd();
698 SCSIZE nEntrySize
= pEntry
->GetSize();
700 if ( nEntryEnd
>= nStartPos
)
702 if ( nEntryStart
> nEndPos
) // Right
703 pEntry
->Move(-(static_cast<SCsCOLROW
>(nSize
)));
704 else if ( nEntryStart
< nStartPos
&& nEntryEnd
>= nEndPos
) // Outside
705 pEntry
->SetSize( nEntrySize
-nSize
);
709 if ( nEntryStart
>= nStartPos
&& nEntryEnd
<= nEndPos
) // Inside
714 else if ( nEntryStart
>= nStartPos
) // Top right
715 pEntry
->SetPosSize( nStartPos
, static_cast<SCSIZE
>(nEntryEnd
-nEndPos
) );
717 pEntry
->SetSize( static_cast<SCSIZE
>(nStartPos
-nEntryStart
) );
728 bool ScOutlineArray::ManualAction(
729 SCCOLROW nStartPos
, SCCOLROW nEndPos
, bool bShow
, const ScTable
& rTable
, bool bCol
)
731 bool bModified
= false;
732 ScSubOutlineIterator
aIter( this );
733 ScOutlineEntry
* pEntry
;
734 while((pEntry
=aIter
.GetNext())!=NULL
)
736 SCCOLROW nEntryStart
= pEntry
->GetStart();
737 SCCOLROW nEntryEnd
= pEntry
->GetEnd();
739 if (nEntryEnd
>=nStartPos
&& nEntryStart
<=nEndPos
)
741 if ( pEntry
->IsHidden() == bShow
)
743 // #i12341# hide if all columns/rows are hidden, show if at least one
745 SCCOLROW nEnd
= rTable
.LastHiddenColRow(nEntryStart
, bCol
);
746 bool bAllHidden
= (nEntryEnd
<= nEnd
&& nEnd
<
747 ::std::numeric_limits
<SCCOLROW
>::max());
749 bool bToggle
= ( bShow
!= bAllHidden
);
752 pEntry
->SetHidden( !bShow
);
753 SetVisibleBelow( aIter
.LastLevel(), aIter
.LastEntry(), bShow
, bShow
);
762 void ScOutlineArray::RemoveAll()
764 for (size_t nLevel
= 0; nLevel
< nDepth
; ++nLevel
)
765 aCollections
[nLevel
].clear();
770 ScOutlineTable::ScOutlineTable()
774 ScOutlineTable::ScOutlineTable( const ScOutlineTable
& rOutline
) :
775 aColOutline( rOutline
.aColOutline
),
776 aRowOutline( rOutline
.aRowOutline
)
780 bool ScOutlineTable::TestInsertCol( SCSIZE nSize
)
782 return aColOutline
.TestInsertSpace( nSize
, MAXCOL
);
785 void ScOutlineTable::InsertCol( SCCOL nStartCol
, SCSIZE nSize
)
787 aColOutline
.InsertSpace( nStartCol
, nSize
);
790 bool ScOutlineTable::DeleteCol( SCCOL nStartCol
, SCSIZE nSize
)
792 return aColOutline
.DeleteSpace( nStartCol
, nSize
);
795 bool ScOutlineTable::TestInsertRow( SCSIZE nSize
)
797 return aRowOutline
.TestInsertSpace( nSize
, MAXROW
);
800 void ScOutlineTable::InsertRow( SCROW nStartRow
, SCSIZE nSize
)
802 aRowOutline
.InsertSpace( nStartRow
, nSize
);
805 bool ScOutlineTable::DeleteRow( SCROW nStartRow
, SCSIZE nSize
)
807 return aRowOutline
.DeleteSpace( nStartRow
, nSize
);
810 ScSubOutlineIterator::ScSubOutlineIterator( ScOutlineArray
* pOutlineArray
) :
811 pArray( pOutlineArray
),
813 nEnd( SCCOLROW_MAX
), // Iterate over all of them
817 nDepth
= pArray
->nDepth
;
820 ScSubOutlineIterator::ScSubOutlineIterator(
821 ScOutlineArray
* pOutlineArray
, size_t nLevel
, size_t nEntry
) :
822 pArray( pOutlineArray
)
824 const ScOutlineCollection
& rColl
= pArray
->aCollections
[nLevel
];
825 ScOutlineCollection::const_iterator it
= rColl
.begin();
826 std::advance(it
, nEntry
);
827 const ScOutlineEntry
* pEntry
= it
->second
;
828 nStart
= pEntry
->GetStart();
829 nEnd
= pEntry
->GetEnd();
830 nSubLevel
= nLevel
+ 1;
832 nDepth
= pArray
->nDepth
;
835 ScOutlineEntry
* ScSubOutlineIterator::GetNext()
837 ScOutlineEntry
* pEntry
= NULL
;
841 if (nSubLevel
>= nDepth
)
844 ScOutlineCollection
& rColl
= pArray
->aCollections
[nSubLevel
];
845 if (nSubEntry
< rColl
.size())
847 ScOutlineCollection::iterator it
= rColl
.begin();
848 std::advance(it
, nSubEntry
);
851 if (pEntry
->GetStart() >= nStart
&& pEntry
->GetEnd() <= nEnd
)
858 // Go to the next sub-level
864 return pEntry
; // nSubLevel valid, if pEntry != 0
867 size_t ScSubOutlineIterator::LastEntry() const
871 OSL_FAIL("ScSubOutlineIterator::LastEntry before GetNext");
877 void ScSubOutlineIterator::DeleteLast()
879 if (nSubLevel
>= nDepth
)
881 OSL_FAIL("ScSubOutlineIterator::DeleteLast after End");
886 OSL_FAIL("ScSubOutlineIterator::DeleteLast before GetNext");
891 ScOutlineCollection
& rColl
= pArray
->aCollections
[nSubLevel
];
892 OSL_ASSERT(nSubEntry
< rColl
.size());
893 ScOutlineCollection::iterator it
= rColl
.begin();
894 std::advance(it
, nSubEntry
);
898 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */