diff options
author | Andre Fischer <af@openoffice.org> | 2010-02-17 15:08:33 +0100 |
---|---|---|
committer | Andre Fischer <af@openoffice.org> | 2010-02-17 15:08:33 +0100 |
commit | 70ebb85a47952a76a58577e1d85f3db3f091d4a4 (patch) | |
tree | 16fe6b3e4d49b3f52d4979f359f79981ad49b6d7 /sd/source/ui/slidesorter/inc | |
parent | b5f80146f4f2d780b1d03249e6f5d7d2d27c6d37 (diff) |
renaissance1: #i107215# Modifying the selection may change the current slide.
Diffstat (limited to 'sd/source/ui/slidesorter/inc')
-rw-r--r-- | sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx b/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx index 7c6616674328..e83cf76511a2 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx @@ -160,10 +160,29 @@ public: the last call to GetPageSelection() it is still valid to call this method with the selection. When pages have been inserted or removed the result may be unexpected. + @param bUpdateCurrentPage + When <TRUE/> (the default value) then after setting the + selection update the current page to the first page of the + selection. + When called from withing UpdateCurrentPage() then this flag is + used to prevent a recursion loop. */ - void SetPageSelection (const ::boost::shared_ptr<PageSelection>& rSelection); + void SetPageSelection ( + const ::boost::shared_ptr<PageSelection>& rSelection, + const bool bUpdateCurrentPage = true); - void UpdateCurrentPage (const model::SharedPageDescriptor& rCurrentPageDescriptor); + /** Use the UpdateLock whenever you do a complex selection, i.e. call + more than one method in a row. An active lock prevents intermediate + changes of the current slide. + */ + class UpdateLock + { + public: + UpdateLock (SlideSorter& rSlideSorter); + ~UpdateLock (void); + private: + PageSelector& mrSelector; + }; private: model::SlideSorterModel& mrModel; @@ -176,8 +195,10 @@ private: /// Anchor for a range selection. model::SharedPageDescriptor mpSelectionAnchor; model::SharedPageDescriptor mpCurrentPage; + sal_Int32 mnUpdateLockCount; void CountSelectedPages (void); + void UpdateCurrentPage (void); }; } } } // end of namespace ::sd::slidesorter::controller |