diff options
author | obo <obo@openoffice.org> | 2010-06-09 15:49:40 +0200 |
---|---|---|
committer | obo <obo@openoffice.org> | 2010-06-09 15:49:40 +0200 |
commit | be83c369478adff5dc00f055953e41f71fdd7ca0 (patch) | |
tree | 3c2c3b101d7260b227693261804948fc4f433338 /sd/source/ui/view/Outliner.cxx | |
parent | 47b5ec4b0b48b7108715cb1e780ad3dca284cfa9 (diff) | |
parent | 03dba8e53007fc760780a8dffd057ec73158d3be (diff) |
CWS-TOOLING: integrate CWS findbar01
Diffstat (limited to 'sd/source/ui/view/Outliner.cxx')
-rwxr-xr-x | sd/source/ui/view/Outliner.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index a7c9786dd160..fd07d966ad47 100755 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -568,7 +568,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()) @@ -603,10 +604,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; } |