diff options
author | Pascal Junck <pjunck@openoffice.org> | 2004-10-28 12:29:43 +0000 |
---|---|---|
committer | Pascal Junck <pjunck@openoffice.org> | 2004-10-28 12:29:43 +0000 |
commit | 44fbbc76a828b06e34b1cf5d2f06b19286a885fe (patch) | |
tree | 73b14c872869d7af5f267e3045bfa4c2e709b5ad /sd/source/ui/slidesorter/controller/SlsPageSelector.cxx | |
parent | e6a80a4d8e30ae3f650a0d3bce60179992d6d685 (diff) |
INTEGRATION: CWS impress20ea (1.2.68); FILE MERGED
2004/09/28 11:37:07 af 1.2.68.2: #i34606# Added methods for getting and restoring the selection.
2004/09/15 08:18:07 af 1.2.68.1: #i34011# Fixed convesion of page indices.
Diffstat (limited to 'sd/source/ui/slidesorter/controller/SlsPageSelector.cxx')
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsPageSelector.cxx | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx index 0933ba82f207..d3cde78d30b8 100644 --- a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx +++ b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx @@ -2,9 +2,9 @@ * * $RCSfile: SlsPageSelector.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2004-07-13 14:15:13 $ + * last change: $Author: pjunck $ $Date: 2004-10-28 13:29:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -164,7 +164,7 @@ void PageSelector::SelectPage (int nPageIndex) void PageSelector::SelectPage (const SdPage* pPage) { - int nPageIndex = pPage->GetPageNum() / 2; + int nPageIndex = (pPage->GetPageNum()-1) / 2; PageDescriptor* pDescriptor = mrModel.GetPageDescriptor(nPageIndex); if (pDescriptor!=NULL && pDescriptor->GetPage()==pPage) SelectPage (*pDescriptor); @@ -203,7 +203,7 @@ void PageSelector::DeselectPage (int nPageIndex) void PageSelector::DeselectPage (const SdPage* pPage) { - int nPageIndex = pPage->GetPageNum() / 2; + int nPageIndex = (pPage->GetPageNum()-1) / 2; PageDescriptor* pDescriptor = mrModel.GetPageDescriptor(nPageIndex); if (pDescriptor!=NULL && pDescriptor->GetPage()==pPage) DeselectPage (*pDescriptor); @@ -360,4 +360,30 @@ void PageSelector::DisableBroadcasting (void) + +::std::auto_ptr<PageSelector::PageSelection> + PageSelector::GetPageSelection (void) +{ + ::std::auto_ptr<PageSelection> pSelection (new PageSelection()); + + int nPageCount = GetPageCount(); + for (int nIndex=0; nIndex<nPageCount; nIndex++) + { + if (IsPageSelected(nIndex)) + pSelection->insert (nIndex); + } + + return pSelection; +} + + + + +void PageSelector::SetPageSelection (const PageSelection& rSelection) +{ + PageSelection::const_iterator iIndex; + for (iIndex=rSelection.begin(); iIndex!=rSelection.end(); ++iIndex) + SelectPage (*iIndex); +} + } } } // end of namespace ::sd::slidesorter::controller |