summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
diff options
context:
space:
mode:
authorJoerg Skottke [jsk] <jsk@openoffice.org>2010-05-31 16:37:05 +0200
committerJoerg Skottke [jsk] <jsk@openoffice.org>2010-05-31 16:37:05 +0200
commit03dba8e53007fc760780a8dffd057ec73158d3be (patch)
tree26cfac09cc1db29c35e4de144bb890c11106c0e1 /sd/source/ui/view
parent89ba05fa4e5bd1a5b91f3c57ce9a31660200b4d8 (diff)
parent5d08b0417da503650e5cf2f301cf579cc84452fe (diff)
findbar01: Local merge with remote repo
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r--sd/source/ui/view/Outliner.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 5314f6dbe768..b757ca3ede27 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -566,7 +566,8 @@ bool Outliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem)
void Outliner::Initialize (bool bDirectionIsForward)
{
- bool bOldDirectionIsForward = mbDirectionIsForward;
+ const bool bIsAtEnd (maObjectIterator == ::sd::outliner::OutlinerContainer(this).end());
+ const bool bOldDirectionIsForward = mbDirectionIsForward;
mbDirectionIsForward = bDirectionIsForward;
if (maObjectIterator == ::sd::outliner::Iterator())
@@ -601,10 +602,19 @@ void Outliner::Initialize (bool bDirectionIsForward)
{
// Requested iteration direction has changed. Turn arround the iterator.
maObjectIterator.Reverse();
- // The iterator has pointed to the object one ahead/before the current
- // one. Now move it to the one before/ahead the current one.
- ++maObjectIterator;
- ++maObjectIterator;
+ if (bIsAtEnd)
+ {
+ // The iterator has pointed to end(), which after the search
+ // direction is reversed, becomes begin().
+ maObjectIterator = ::sd::outliner::OutlinerContainer(this).begin();
+ }
+ else
+ {
+ // The iterator has pointed to the object one ahead/before the current
+ // one. Now move it to the one before/ahead the current one.
+ ++maObjectIterator;
+ ++maObjectIterator;
+ }
mbMatchMayExist = true;
}