diff options
Diffstat (limited to 'sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx')
-rwxr-xr-x | sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 108 |
1 files changed, 72 insertions, 36 deletions
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 86ec4002cd02..f8e7e13cdd2b 100755 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -39,6 +39,8 @@ #include "controller/SlsSlotManager.hxx" #include "controller/SlsCurrentSlideManager.hxx" #include "controller/SlsSelectionManager.hxx" +#include "controller/SlsSelectionFunction.hxx" +#include "controller/SlsProperties.hxx" #include "view/SlideSorterView.hxx" #include "view/SlsLayouter.hxx" #include "model/SlideSorterModel.hxx" @@ -97,8 +99,11 @@ TYPEINIT1(SlideSorterViewShell, ViewShell); SfxViewFrame* pFrame, ViewShellBase& rViewShellBase, ::Window* pParentWindow, - FrameView* pFrameViewArgument) + FrameView* pFrameViewArgument, + const bool bIsCenterPane) { + (void)bIsCenterPane; + ::boost::shared_ptr<SlideSorterViewShell> pViewShell; try { @@ -124,7 +129,8 @@ SlideSorterViewShell::SlideSorterViewShell ( ::Window* pParentWindow, FrameView* pFrameViewArgument) : ViewShell (pFrame, pParentWindow, rViewShellBase), - mpSlideSorter() + mpSlideSorter(), + mbIsArrangeGUIElementsPending(true) { meShellType = ST_SLIDE_SORTER; @@ -188,8 +194,8 @@ void SlideSorterViewShell::Initialize (void) // the new view shell. (One is created earlier while the construtor // of the base class is executed. At that time the correct // accessibility object can not be constructed.) - ::Window* pWindow = mpSlideSorter->GetActiveWindow(); - if (pWindow != NULL) + SharedSdWindow pWindow (mpSlideSorter->GetContentWindow()); + if (pWindow) { pWindow->Hide(); pWindow->Show(); @@ -299,8 +305,17 @@ SlideSorter& SlideSorterViewShell::GetSlideSorter (void) const bool SlideSorterViewShell::RelocateToParentWindow (::Window* pParentWindow) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); - return mpSlideSorter->RelocateToWindow(pParentWindow); + OSL_ASSERT(mpSlideSorter); + if ( ! mpSlideSorter) + return false; + + if (pParentWindow == NULL) + WriteFrameViewData(); + const bool bSuccess (mpSlideSorter->RelocateToWindow(pParentWindow)); + if (pParentWindow != NULL) + ReadFrameViewData(mpFrameView); + + return bSuccess; } @@ -377,6 +392,11 @@ SdPage* SlideSorterViewShell::GetActualPage (void) pCurrentPage = pDescriptor->GetPage(); } + if (pCurrentPage == NULL) + { + + } + return pCurrentPage; } @@ -496,23 +516,13 @@ void SlideSorterViewShell::ExecStatusBar (SfxRequest& rRequest) -void SlideSorterViewShell::PrePaint() -{ - OSL_ASSERT(mpSlideSorter.get()!=NULL); - if (mpSlideSorter.get() != NULL) - mpSlideSorter->GetController().PrePaint(); -} - - - - void SlideSorterViewShell::Paint ( const Rectangle& rBBox, ::sd::Window* pWindow) { SetActiveWindow (pWindow); - OSL_ASSERT(mpSlideSorter.get()!=NULL); - if (mpSlideSorter.get() != NULL) + OSL_ASSERT(mpSlideSorter); + if (mpSlideSorter) mpSlideSorter->GetController().Paint(rBBox,pWindow); } @@ -521,10 +531,24 @@ void SlideSorterViewShell::Paint ( void SlideSorterViewShell::ArrangeGUIElements (void) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); - mpSlideSorter->ArrangeGUIElements( - maViewPos, - maViewSize); + if (IsActive()) + { + OSL_ASSERT(mpSlideSorter.get()!=NULL); + mpSlideSorter->ArrangeGUIElements(maViewPos, maViewSize); + mbIsArrangeGUIElementsPending = false; + } + else + mbIsArrangeGUIElementsPending = true; +} + + + + +void SlideSorterViewShell::Activate (BOOL bIsMDIActivate) +{ + ViewShell::Activate(bIsMDIActivate); + if (mbIsArrangeGUIElementsPending) + ArrangeGUIElements(); } @@ -559,28 +583,38 @@ void SlideSorterViewShell::ReadFrameViewData (FrameView* pFrameView) view::SlideSorterView& rView (mpSlideSorter->GetView()); USHORT nSlidesPerRow (pFrameView->GetSlidesPerRow()); - if (nSlidesPerRow == 0 || ! IsMainViewShell()) + if (nSlidesPerRow > 0 + && rView.GetOrientation() == view::Layouter::GRID + && IsMainViewShell()) { - // When a value of 0 (automatic) is given or the the slide - // sorter is displayed in a side pane then we ignore the value - // of the frame view and adapt the number of columns - // automatically to the window width. - rView.GetLayouter().SetColumnCount(1,5); - } - else rView.GetLayouter().SetColumnCount(nSlidesPerRow,nSlidesPerRow); + } + if (IsMainViewShell()) + mpSlideSorter->GetController().GetCurrentSlideManager()->NotifyCurrentSlideChange( + mpFrameView->GetSelectedPage()); mpSlideSorter->GetController().Rearrange(true); // DrawMode for 'main' window if (GetActiveWindow()->GetDrawMode() != pFrameView->GetDrawMode() ) GetActiveWindow()->SetDrawMode( pFrameView->GetDrawMode() ); } + + // When this slide sorter is not displayed in the main window then we do + // not share the same frame view and have to find other ways to acquire + // certain values. + if ( ! IsMainViewShell()) + { + ::boost::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); + if (pMainViewShell.get() != NULL) + mpSlideSorter->GetController().GetCurrentSlideManager()->NotifyCurrentSlideChange( + pMainViewShell->getCurrentPage()); + } } -void SlideSorterViewShell::WriteFrameViewData() +void SlideSorterViewShell::WriteFrameViewData (void) { OSL_ASSERT(mpSlideSorter.get()!=NULL); if (mpFrameView != NULL) @@ -595,9 +629,11 @@ void SlideSorterViewShell::WriteFrameViewData() SdPage* pActualPage = GetActualPage(); if (pActualPage != NULL) { + if (IsMainViewShell()) + mpFrameView->SetSelectedPage((pActualPage->GetPageNum()- 1) / 2); + // else // The slide sorter is not expected to switch the current page // other then by double clicks. That is handled seperatly. - // mpFrameView->SetSelectedPage((pActualPage->GetPageNum()- 1) / 2); } else { @@ -619,13 +655,13 @@ void SlideSorterViewShell::SetZoom (long int ) // the window. } + + + void SlideSorterViewShell::SetZoomRect (const Rectangle& rZoomRect) { OSL_ASSERT(mpSlideSorter.get()!=NULL); - Size aPageSize (mpSlideSorter->GetView().GetPageBoundingBox( - 0, - view::SlideSorterView::CS_MODEL, - view::SlideSorterView::BBT_SHAPE).GetSize()); + Size aPageSize (mpSlideSorter->GetView().GetLayouter().GetPageObjectSize()); Rectangle aRect(rZoomRect); |