LCOV - code coverage report
Current view: top level - libreoffice/sd/source/ui/slidesorter/controller - SlideSorterController.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 420 0.0 %
Date: 2012-12-27 Functions: 0 48 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : 
      21             : #include "controller/SlideSorterController.hxx"
      22             : 
      23             : #include "SlideSorter.hxx"
      24             : #include "controller/SlsPageSelector.hxx"
      25             : #include "controller/SlsSelectionFunction.hxx"
      26             : #include "controller/SlsProperties.hxx"
      27             : #include "controller/SlsCurrentSlideManager.hxx"
      28             : #include "SlsListener.hxx"
      29             : #include "controller/SlsFocusManager.hxx"
      30             : #include "controller/SlsAnimator.hxx"
      31             : #include "controller/SlsClipboard.hxx"
      32             : #include "controller/SlsInsertionIndicatorHandler.hxx"
      33             : #include "controller/SlsScrollBarManager.hxx"
      34             : #include "controller/SlsSelectionManager.hxx"
      35             : #include "controller/SlsSlotManager.hxx"
      36             : #include "controller/SlsTransferableData.hxx"
      37             : #include "controller/SlsVisibleAreaManager.hxx"
      38             : #include "model/SlideSorterModel.hxx"
      39             : #include "model/SlsPageEnumerationProvider.hxx"
      40             : #include "model/SlsPageDescriptor.hxx"
      41             : #include "view/SlideSorterView.hxx"
      42             : #include "view/SlsLayouter.hxx"
      43             : #include "view/SlsFontProvider.hxx"
      44             : #include "view/SlsPageObjectLayouter.hxx"
      45             : #include "view/SlsPageObjectPainter.hxx"
      46             : #include "view/SlsTheme.hxx"
      47             : #include "view/SlsToolTip.hxx"
      48             : #include "cache/SlsPageCache.hxx"
      49             : #include "cache/SlsPageCacheManager.hxx"
      50             : 
      51             : #include "drawdoc.hxx"
      52             : #include "DrawViewShell.hxx"
      53             : #include "TextLogger.hxx"
      54             : #include "ViewShellBase.hxx"
      55             : #include "Window.hxx"
      56             : #include "FrameView.hxx"
      57             : #include "DrawDocShell.hxx"
      58             : #include "sdpage.hxx"
      59             : #include "res_bmp.hrc"
      60             : #include "sdresid.hxx"
      61             : #include "strings.hrc"
      62             : #include "app.hrc"
      63             : #include "glob.hrc"
      64             : #include "sdmod.hxx"
      65             : #include "sdxfer.hxx"
      66             : #include "ViewShellHint.hxx"
      67             : #include "AccessibleSlideSorterView.hxx"
      68             : #include "AccessibleSlideSorterObject.hxx"
      69             : 
      70             : #include <vcl/window.hxx>
      71             : #include <svx/svdopage.hxx>
      72             : #include <svx/svxids.hrc>
      73             : #include <svx/ruler.hxx>
      74             : #include <sfx2/zoomitem.hxx>
      75             : #include <svtools/tabbar.hxx>
      76             : #include <sfx2/request.hxx>
      77             : #include <sfx2/viewfrm.hxx>
      78             : #include <sfx2/dispatch.hxx>
      79             : #include <vcl/svapp.hxx>
      80             : 
      81             : #include <com/sun/star/lang/XComponent.hpp>
      82             : #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
      83             : #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
      84             : #include <com/sun/star/drawing/XDrawPages.hpp>
      85             : #include <com/sun/star/accessibility/AccessibleEventId.hpp>
      86             : 
      87             : using namespace ::com::sun::star;
      88             : using namespace ::com::sun::star::uno;
      89             : using namespace ::sd::slidesorter::model;
      90             : using namespace ::sd::slidesorter::view;
      91             : using namespace ::sd::slidesorter::controller;
      92             : using namespace ::basegfx;
      93             : 
      94             : namespace sd { namespace slidesorter { namespace controller {
      95             : 
      96             : 
      97           0 : SlideSorterController::SlideSorterController (SlideSorter& rSlideSorter)
      98             :     : mrSlideSorter(rSlideSorter),
      99           0 :       mrModel(mrSlideSorter.GetModel()),
     100           0 :       mrView(mrSlideSorter.GetView()),
     101             :       mpPageSelector(),
     102             :       mpFocusManager(),
     103             :       mpSlotManager(),
     104             :       mpScrollBarManager(),
     105             :       mpCurrentSlideManager(),
     106             :       mpSelectionManager(),
     107             :       mpClipboard(),
     108           0 :       mpInsertionIndicatorHandler(new InsertionIndicatorHandler(rSlideSorter)),
     109           0 :       mpAnimator(new Animator(rSlideSorter)),
     110           0 :       mpVisibleAreaManager(new VisibleAreaManager(rSlideSorter)),
     111             :       mpListener(),
     112             :       mnModelChangeLockCount(0),
     113             :       mbIsForcedRearrangePending(false),
     114             :       mbPreModelChangeDone(false),
     115             :       mbPostModelChangePending(false),
     116             :       maSelectionBeforeSwitch(),
     117             :       mnCurrentPageBeforeSwitch(0),
     118             :       mpEditModeChangeMasterPage(NULL),
     119             :       maTotalWindowArea(),
     120             :       mnPaintEntranceCount(0),
     121           0 :       mbIsContextMenuOpen(false)
     122             : {
     123           0 :     SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
     124             :     OSL_ASSERT(pWindow);
     125           0 :     if (pWindow)
     126             :     {
     127             :         // The whole background is painted by the view and controls.
     128           0 :         ::Window* pParentWindow = pWindow->GetParent();
     129             :         OSL_ASSERT(pParentWindow!=NULL);
     130           0 :         pParentWindow->SetBackground (Wallpaper());
     131             : 
     132             :         // Connect the view with the window that has been created by our base
     133             :         // class.
     134           0 :         pWindow->SetBackground(Wallpaper());
     135           0 :         pWindow->SetCenterAllowed(false);
     136           0 :         pWindow->SetMapMode(MapMode(MAP_PIXEL));
     137           0 :         pWindow->SetViewSize(mrView.GetModelArea().GetSize());
     138           0 :     }
     139           0 : }
     140             : 
     141             : 
     142             : 
     143             : 
     144           0 : void SlideSorterController::Init (void)
     145             : {
     146           0 :     mpCurrentSlideManager.reset(new CurrentSlideManager(mrSlideSorter));
     147           0 :     mpPageSelector.reset(new PageSelector(mrSlideSorter));
     148           0 :     mpFocusManager.reset(new FocusManager(mrSlideSorter));
     149           0 :     mpSlotManager.reset(new SlotManager(mrSlideSorter));
     150           0 :     mpScrollBarManager.reset(new ScrollBarManager(mrSlideSorter));
     151           0 :     mpSelectionManager.reset(new SelectionManager(mrSlideSorter));
     152           0 :     mpClipboard.reset(new Clipboard(mrSlideSorter));
     153             : 
     154           0 :     mpScrollBarManager->LateInitialization();
     155             : 
     156             :     // Create the selection function.
     157             :     SfxRequest aRequest (
     158             :         SID_OBJECT_SELECT,
     159             :         0,
     160           0 :         mrModel.GetDocument()->GetItemPool());
     161           0 :     mrSlideSorter.SetCurrentFunction(CreateSelectionFunction(aRequest));
     162             : 
     163           0 :     mpListener = new Listener(mrSlideSorter);
     164             : 
     165           0 :     mpPageSelector->GetCoreSelection();
     166           0 :     GetSelectionManager()->SelectionHasChanged();
     167           0 : }
     168             : 
     169             : 
     170             : 
     171             : 
     172           0 : SlideSorterController::~SlideSorterController (void)
     173             : {
     174             :     try
     175             :     {
     176             :         uno::Reference<lang::XComponent> xComponent (
     177           0 :             static_cast<XWeak*>(mpListener.get()), uno::UNO_QUERY);
     178           0 :         if (xComponent.is())
     179           0 :             xComponent->dispose();
     180             :     }
     181           0 :     catch( uno::Exception& )
     182             :     {
     183             :         OSL_FAIL( "sd::SlideSorterController::~SlideSorterController(), exception caught!" );
     184             :     }
     185             : 
     186             :     // dispose should have been called by now so that nothing is to be done
     187             :     // to shut down cleanly.
     188           0 : }
     189             : 
     190             : 
     191             : 
     192             : 
     193           0 : void SlideSorterController::Dispose (void)
     194             : {
     195           0 :     mpInsertionIndicatorHandler->End(Animator::AM_Immediate);
     196           0 :     mpClipboard.reset();
     197           0 :     mpSelectionManager.reset();
     198           0 :     mpAnimator->Dispose();
     199           0 : }
     200             : 
     201             : 
     202             : 
     203             : 
     204           0 : model::SharedPageDescriptor SlideSorterController::GetPageAt (
     205             :     const Point& aWindowPosition)
     206             : {
     207           0 :     sal_Int32 nHitPageIndex (mrView.GetPageIndexAtPoint(aWindowPosition));
     208           0 :     model::SharedPageDescriptor pDescriptorAtPoint;
     209           0 :     if (nHitPageIndex >= 0)
     210             :     {
     211           0 :         pDescriptorAtPoint = mrModel.GetPageDescriptor(nHitPageIndex);
     212             : 
     213             :         // Depending on a property we may have to check that the mouse is no
     214             :         // just over the page object but over the preview area.
     215           0 :         if (pDescriptorAtPoint
     216           0 :             && mrSlideSorter.GetProperties()->IsOnlyPreviewTriggersMouseOver()
     217           0 :             && ! pDescriptorAtPoint->HasState(PageDescriptor::ST_Selected))
     218             :         {
     219             :             // Make sure that the mouse is over the preview area.
     220           0 :             if ( ! mrView.GetLayouter().GetPageObjectLayouter()->GetBoundingBox(
     221             :                 pDescriptorAtPoint,
     222             :                 view::PageObjectLayouter::Preview,
     223           0 :                 view::PageObjectLayouter::WindowCoordinateSystem).IsInside(aWindowPosition))
     224             :             {
     225           0 :                 pDescriptorAtPoint.reset();
     226             :             }
     227             :         }
     228             :     }
     229             : 
     230           0 :     return pDescriptorAtPoint;
     231             : }
     232             : 
     233             : 
     234             : 
     235             : 
     236           0 : PageSelector& SlideSorterController::GetPageSelector (void)
     237             : {
     238             :     OSL_ASSERT(mpPageSelector.get()!=NULL);
     239           0 :     return *mpPageSelector.get();
     240             : }
     241             : 
     242             : 
     243             : 
     244             : 
     245           0 : FocusManager& SlideSorterController::GetFocusManager (void)
     246             : {
     247             :     OSL_ASSERT(mpFocusManager.get()!=NULL);
     248           0 :     return *mpFocusManager.get();
     249             : }
     250             : 
     251             : 
     252             : 
     253             : 
     254           0 : Clipboard& SlideSorterController::GetClipboard (void)
     255             : {
     256             :     OSL_ASSERT(mpClipboard.get()!=NULL);
     257           0 :     return *mpClipboard.get();
     258             : }
     259             : 
     260             : 
     261             : 
     262             : 
     263           0 : ScrollBarManager& SlideSorterController::GetScrollBarManager (void)
     264             : {
     265             :     OSL_ASSERT(mpScrollBarManager.get()!=NULL);
     266           0 :     return *mpScrollBarManager.get();
     267             : }
     268             : 
     269             : 
     270             : 
     271             : 
     272           0 : ::boost::shared_ptr<CurrentSlideManager> SlideSorterController::GetCurrentSlideManager (void) const
     273             : {
     274             :     OSL_ASSERT(mpCurrentSlideManager.get()!=NULL);
     275           0 :     return mpCurrentSlideManager;
     276             : }
     277             : 
     278             : 
     279             : 
     280             : 
     281           0 : ::boost::shared_ptr<SlotManager> SlideSorterController::GetSlotManager (void) const
     282             : {
     283             :     OSL_ASSERT(mpSlotManager.get()!=NULL);
     284           0 :     return mpSlotManager;
     285             : }
     286             : 
     287             : 
     288             : 
     289             : 
     290           0 : ::boost::shared_ptr<SelectionManager> SlideSorterController::GetSelectionManager (void) const
     291             : {
     292             :     OSL_ASSERT(mpSelectionManager.get()!=NULL);
     293           0 :     return mpSelectionManager;
     294             : }
     295             : 
     296             : 
     297             : 
     298             : 
     299             : ::boost::shared_ptr<InsertionIndicatorHandler>
     300           0 :     SlideSorterController::GetInsertionIndicatorHandler (void) const
     301             : {
     302             :     OSL_ASSERT(mpInsertionIndicatorHandler.get()!=NULL);
     303           0 :     return mpInsertionIndicatorHandler;
     304             : }
     305             : 
     306             : 
     307             : 
     308             : 
     309           0 : void SlideSorterController::Paint (
     310             :     const Rectangle& rBBox,
     311             :     ::Window* pWindow)
     312             : {
     313           0 :     if (mnPaintEntranceCount == 0)
     314             :     {
     315           0 :         ++mnPaintEntranceCount;
     316             : 
     317             :         try
     318             :         {
     319           0 :             mrView.CompleteRedraw(pWindow, Region(rBBox), 0);
     320             :         }
     321           0 :         catch (const Exception&)
     322             :         {
     323             :             // Ignore all exceptions.
     324             :         }
     325             : 
     326           0 :         --mnPaintEntranceCount;
     327             :     }
     328           0 : }
     329             : 
     330             : 
     331             : 
     332             : 
     333           0 : void SlideSorterController::FuTemporary (SfxRequest& rRequest)
     334             : {
     335           0 :     mpSlotManager->FuTemporary (rRequest);
     336           0 : }
     337             : 
     338             : 
     339             : 
     340             : 
     341           0 : void SlideSorterController::FuPermanent (SfxRequest &rRequest)
     342             : {
     343           0 :     mpSlotManager->FuPermanent (rRequest);
     344           0 : }
     345             : 
     346             : 
     347             : 
     348             : 
     349           0 : void SlideSorterController::FuSupport (SfxRequest &rRequest)
     350             : {
     351           0 :     mpSlotManager->FuSupport (rRequest);
     352           0 : }
     353             : 
     354             : 
     355             : 
     356             : 
     357           0 : bool SlideSorterController::Command (
     358             :     const CommandEvent& rEvent,
     359             :     ::sd::Window* pWindow)
     360             : {
     361           0 :     bool bEventHasBeenHandled = false;
     362             : 
     363           0 :     if (pWindow == NULL)
     364           0 :         return false;
     365             : 
     366           0 :     ViewShell* pViewShell = mrSlideSorter.GetViewShell();
     367           0 :     if (pViewShell == NULL)
     368           0 :         return false;
     369             : 
     370           0 :     switch (rEvent.GetCommand())
     371             :     {
     372             :         case COMMAND_CONTEXTMENU:
     373             :         {
     374           0 :             SdPage* pPage = NULL;
     375             :             sal_uInt16 nPopupId;
     376             : 
     377             :             model::PageEnumeration aSelectedPages (
     378           0 :                 PageEnumerationProvider::CreateSelectedPagesEnumeration(mrModel));
     379           0 :             if (aSelectedPages.HasMoreElements())
     380           0 :                 pPage = aSelectedPages.GetNextElement()->GetPage();
     381             : 
     382             :             // Choose the popup menu depending on a) the type of the main
     383             :             // view shell, b) the edit mode, and c) on whether the selection
     384             :             // is empty or not.
     385           0 :             ViewShell::ShellType eMainViewShellType (ViewShell::ST_NONE);
     386             :             ::boost::shared_ptr<ViewShell> pMainViewShell (
     387           0 :                 pViewShell->GetViewShellBase().GetMainViewShell());
     388           0 :             if (pMainViewShell.get() != NULL)
     389           0 :                 eMainViewShellType = pMainViewShell->GetShellType();
     390           0 :             switch (eMainViewShellType)
     391             :             {
     392             :                 case ViewShell::ST_DRAW:
     393           0 :                     if (pPage != NULL)
     394           0 :                         nPopupId = RID_SLIDE_SORTER_DRAW_SEL_POPUP;
     395             :                     else
     396           0 :                         nPopupId = RID_SLIDE_SORTER_DRAW_NOSEL_POPUP;
     397           0 :                     break;
     398             : 
     399             :                 default:
     400           0 :                     if (mrModel.GetEditMode() == EM_PAGE)
     401           0 :                         if (pPage != NULL)
     402           0 :                             nPopupId = RID_SLIDE_SORTER_IMPRESS_SEL_POPUP;
     403             :                         else
     404           0 :                             nPopupId = RID_SLIDE_SORTER_IMPRESS_NOSEL_POPUP;
     405             :                     else
     406           0 :                         if (pPage != NULL)
     407           0 :                             nPopupId = RID_SLIDE_SORTER_MASTER_SEL_POPUP;
     408             :                         else
     409           0 :                             nPopupId = RID_SLIDE_SORTER_MASTER_NOSEL_POPUP;
     410             :             }
     411           0 :             ::boost::scoped_ptr<InsertionIndicatorHandler::ForceShowContext> pContext;
     412           0 :             if (pPage == NULL)
     413             :             {
     414             :                 // When there is no selection, then we show the insertion
     415             :                 // indicator so that the user knows where a page insertion
     416             :                 // would take place.
     417           0 :                 mpInsertionIndicatorHandler->Start(false);
     418           0 :                 mpInsertionIndicatorHandler->UpdateIndicatorIcon(SD_MOD()->pTransferClip);
     419             :                 mpInsertionIndicatorHandler->UpdatePosition(
     420           0 :                     pWindow->PixelToLogic(rEvent.GetMousePosPixel()),
     421           0 :                     InsertionIndicatorHandler::MoveMode);
     422             :                 pContext.reset(new InsertionIndicatorHandler::ForceShowContext(
     423           0 :                     mpInsertionIndicatorHandler));
     424             :             }
     425             : 
     426           0 :             pWindow->ReleaseMouse();
     427             : 
     428           0 :             Point aMenuLocation (0,0);
     429           0 :             if (rEvent.IsMouseEvent())
     430             :             {
     431             :                 // We have to explicitly specify the location of the menu
     432             :                 // when the slide sorter is placed in an undocked child
     433             :                 // menu.  But when it is docked it does not hurt, so we
     434             :                 // specify the location always.
     435           0 :                 aMenuLocation = rEvent.GetMousePosPixel();
     436             :             }
     437             :             else
     438             :             {
     439             :                 // The event is not a mouse event.  Use the center of the
     440             :                 // focused page as top left position of the context menu.
     441             :                 model::SharedPageDescriptor pDescriptor (
     442           0 :                     GetFocusManager().GetFocusedPageDescriptor());
     443           0 :                 if (pDescriptor.get() != NULL)
     444             :                 {
     445             :                     Rectangle aBBox (
     446           0 :                         mrView.GetLayouter().GetPageObjectLayouter()->GetBoundingBox (
     447             :                             pDescriptor,
     448             :                             PageObjectLayouter::PageObject,
     449           0 :                             PageObjectLayouter::ModelCoordinateSystem));
     450           0 :                     aMenuLocation = aBBox.Center();
     451           0 :                 }
     452             :             }
     453             : 
     454           0 :             mbIsContextMenuOpen = true;
     455           0 :             if (pViewShell != NULL)
     456             :             {
     457           0 :                 SfxDispatcher* pDispatcher = pViewShell->GetDispatcher();
     458           0 :                 if (pDispatcher != NULL)
     459             :                 {
     460             :                     pDispatcher->ExecutePopup(
     461             :                         SdResId(nPopupId),
     462             :                         pWindow,
     463           0 :                         &aMenuLocation);
     464           0 :                     mrSlideSorter.GetView().UpdatePageUnderMouse();
     465           0 :                     ::rtl::Reference<SelectionFunction> pFunction(GetCurrentSelectionFunction());
     466           0 :                     if (pFunction.is())
     467           0 :                         pFunction->ResetMouseAnchor();
     468             :                 }
     469             :             }
     470           0 :             mbIsContextMenuOpen = false;
     471           0 :             if (pPage == NULL)
     472             :             {
     473             :                 // Remember the position of the insertion indicator before
     474             :                 // it is hidden, so that a pending slide insertion slot call
     475             :                 // finds the right place to insert a new slide.
     476             :                 GetSelectionManager()->SetInsertionPosition(
     477           0 :                     GetInsertionIndicatorHandler()->GetInsertionPageIndex());
     478             :             }
     479           0 :             pContext.reset();
     480           0 :             bEventHasBeenHandled = true;
     481             :         }
     482           0 :         break;
     483             : 
     484             :         case COMMAND_WHEEL:
     485             :         {
     486           0 :             const CommandWheelData* pData = rEvent.GetWheelData();
     487           0 :             if (pData == NULL)
     488           0 :                 return false;
     489           0 :             if (pData->IsMod1())
     490             :             {
     491             :                 // We do not support zooming with control+mouse wheel.
     492           0 :                 return false;
     493             :             }
     494             :             // Determine whether to scroll horizontally or vertically.  This
     495             :             // depends on the orientation of the scroll bar and the
     496             :             // IsHoriz() flag of the event.
     497           0 :             if ((mrSlideSorter.GetView().GetOrientation()==view::Layouter::HORIZONTAL)
     498           0 :                 == pData->IsHorz())
     499             :             {
     500           0 :                 GetScrollBarManager().Scroll(
     501             :                     ScrollBarManager::Orientation_Vertical,
     502             :                     ScrollBarManager::Unit_Slide,
     503           0 :                     -pData->GetNotchDelta());
     504             :             }
     505             :             else
     506             :             {
     507           0 :                 GetScrollBarManager().Scroll(
     508             :                     ScrollBarManager::Orientation_Horizontal,
     509             :                     ScrollBarManager::Unit_Slide,
     510           0 :                     -pData->GetNotchDelta());
     511             :             }
     512           0 :             mrSlideSorter.GetView().UpdatePageUnderMouse(rEvent.GetMousePosPixel());
     513             : 
     514           0 :             bEventHasBeenHandled = true;
     515             :         }
     516           0 :         break;
     517             :     }
     518             : 
     519           0 :     return bEventHasBeenHandled;
     520             : }
     521             : 
     522             : 
     523             : 
     524             : 
     525           0 : void SlideSorterController::LockModelChange (void)
     526             : {
     527           0 :     mnModelChangeLockCount += 1;
     528           0 : }
     529             : 
     530             : 
     531             : 
     532             : 
     533           0 : void SlideSorterController::UnlockModelChange (void)
     534             : {
     535           0 :     mnModelChangeLockCount -= 1;
     536           0 :     if (mnModelChangeLockCount==0 && mbPostModelChangePending)
     537             :     {
     538           0 :         PostModelChange();
     539             :     }
     540           0 : }
     541             : 
     542             : 
     543             : 
     544             : 
     545           0 : void SlideSorterController::PreModelChange (void)
     546             : {
     547             :     // Prevent PreModelChange to execute more than once per model lock.
     548           0 :     if (mbPostModelChangePending)
     549           0 :         return;
     550           0 :     mbPreModelChangeDone = true;
     551             : 
     552           0 :     if (mrSlideSorter.GetViewShell() != NULL)
     553           0 :         mrSlideSorter.GetViewShell()->Broadcast(
     554           0 :             ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_START));
     555             : 
     556           0 :     GetCurrentSlideManager()->PrepareModelChange();
     557             : 
     558           0 :     if (mrSlideSorter.GetContentWindow())
     559           0 :         mrView.PreModelChange();
     560             : 
     561           0 :     mbPostModelChangePending = true;
     562             : }
     563             : 
     564             : 
     565             : 
     566             : 
     567           0 : void SlideSorterController::PostModelChange (void)
     568             : {
     569           0 :     mbPostModelChangePending = false;
     570           0 :     mrModel.Resync();
     571             : 
     572           0 :     SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
     573           0 :     if (pWindow)
     574             :     {
     575           0 :         GetCurrentSlideManager()->HandleModelChange();
     576             : 
     577           0 :         mrView.PostModelChange ();
     578             : 
     579           0 :         pWindow->SetViewOrigin (Point (0,0));
     580           0 :         pWindow->SetViewSize (mrView.GetModelArea().GetSize());
     581             : 
     582             :         // The visibility of the scroll bars may have to be changed.  Then
     583             :         // the size of the view has to change, too.  Let Rearrange() handle
     584             :         // that.
     585           0 :         Rearrange(mbIsForcedRearrangePending);
     586             :     }
     587             : 
     588           0 :     if (mrSlideSorter.GetViewShell() != NULL)
     589           0 :         mrSlideSorter.GetViewShell()->Broadcast(
     590           0 :             ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END));
     591           0 : }
     592             : 
     593             : 
     594             : 
     595             : 
     596           0 : void SlideSorterController::HandleModelChange (void)
     597             : {
     598             :     // Ignore this call when the document is not in a valid state, i.e. has
     599             :     // not the same number of regular and notes pages.
     600           0 :     bool bIsDocumentValid = (mrModel.GetDocument()->GetPageCount() % 2 == 1);
     601             : 
     602           0 :     if (bIsDocumentValid)
     603             :     {
     604           0 :         ModelChangeLock aLock (*this);
     605           0 :         PreModelChange();
     606             :     }
     607           0 : }
     608             : 
     609             : 
     610             : 
     611             : 
     612           0 : IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent)
     613             : {
     614           0 :     if (pEvent != NULL)
     615             :     {
     616           0 :         ::Window* pWindow = pEvent->GetWindow();
     617           0 :         SharedSdWindow pActiveWindow (mrSlideSorter.GetContentWindow());
     618           0 :         switch (pEvent->GetId())
     619             :         {
     620             :             case VCLEVENT_WINDOW_ACTIVATE:
     621             :             case VCLEVENT_WINDOW_SHOW:
     622           0 :                 if (pActiveWindow && pWindow == pActiveWindow->GetParent())
     623           0 :                     mrView.RequestRepaint();
     624           0 :                 break;
     625             : 
     626             :             case VCLEVENT_WINDOW_HIDE:
     627           0 :                 if (pActiveWindow && pWindow == pActiveWindow->GetParent())
     628           0 :                     mrView.SetPageUnderMouse(SharedPageDescriptor());
     629           0 :                 break;
     630             : 
     631             :             case VCLEVENT_WINDOW_GETFOCUS:
     632           0 :                 if (pActiveWindow)
     633           0 :                     if (pWindow == pActiveWindow.get())
     634           0 :                         GetFocusManager().ShowFocus(false);
     635           0 :                 break;
     636             : 
     637             :             case VCLEVENT_WINDOW_LOSEFOCUS:
     638           0 :                 if (pActiveWindow && pWindow == pActiveWindow.get())
     639             :                 {
     640           0 :                     GetFocusManager().HideFocus();
     641           0 :                     mrView.GetToolTip().Hide();
     642             : 
     643             :                     // Select the current slide so that it is properly
     644             :                     // visualized when the focus is moved to the edit view.
     645           0 :                     GetPageSelector().SelectPage(GetCurrentSlideManager()->GetCurrentSlide());
     646             :                 }
     647           0 :                 break;
     648             : 
     649             :             case VCLEVENT_APPLICATION_DATACHANGED:
     650             :             {
     651             :                 // Invalidate the preview cache.
     652           0 :                 cache::PageCacheManager::Instance()->InvalidateAllCaches();
     653             : 
     654             :                 // Update the draw mode.
     655           0 :                 sal_uLong nDrawMode (Application::GetSettings().GetStyleSettings().GetHighContrastMode()
     656             :                     ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
     657           0 :                     : ViewShell::OUTPUT_DRAWMODE_COLOR);
     658           0 :                 if (mrSlideSorter.GetViewShell() != NULL)
     659           0 :                     mrSlideSorter.GetViewShell()->GetFrameView()->SetDrawMode(nDrawMode);
     660           0 :                 if (pActiveWindow != NULL)
     661           0 :                     pActiveWindow->SetDrawMode(nDrawMode);
     662           0 :                 mrView.HandleDrawModeChange();
     663             : 
     664             :                 // When the system font has changed a layout has to be done.
     665           0 :                 mrView.Resize();
     666           0 :                 FontProvider::Instance().Invalidate();
     667             : 
     668             :                 // Update theme colors.
     669           0 :                 mrSlideSorter.GetProperties()->HandleDataChangeEvent();
     670           0 :                 mrSlideSorter.GetTheme()->Update(mrSlideSorter.GetProperties());
     671           0 :                 mrView.HandleDataChangeEvent();
     672             :             }
     673           0 :             break;
     674             : 
     675             :             default:
     676           0 :                 break;
     677           0 :         }
     678             :     }
     679             : 
     680           0 :     return sal_True;
     681             : }
     682             : 
     683             : 
     684             : 
     685             : 
     686           0 : void SlideSorterController::GetCtrlState (SfxItemSet& rSet)
     687             : {
     688           0 :     if (rSet.GetItemState(SID_RELOAD) != SFX_ITEM_UNKNOWN)
     689             :     {
     690             :         // "Letzte Version" vom SFx en/disablen lassen
     691           0 :         SfxViewFrame* pSlideViewFrame = SfxViewFrame::Current();
     692             :         DBG_ASSERT(pSlideViewFrame!=NULL,
     693             :             "SlideSorterController::GetCtrlState: ViewFrame not found");
     694           0 :         if (pSlideViewFrame)
     695             :         {
     696           0 :             pSlideViewFrame->GetSlotState (SID_RELOAD, NULL, &rSet);
     697             :         }
     698             :         else        // MI sagt: kein MDIFrame --> disablen
     699             :         {
     700           0 :             rSet.DisableItem(SID_RELOAD);
     701             :         }
     702             :     }
     703             : 
     704             :     // Output quality.
     705           0 :     if (rSet.GetItemState(SID_OUTPUT_QUALITY_COLOR)==SFX_ITEM_AVAILABLE
     706           0 :         ||rSet.GetItemState(SID_OUTPUT_QUALITY_GRAYSCALE)==SFX_ITEM_AVAILABLE
     707           0 :         ||rSet.GetItemState(SID_OUTPUT_QUALITY_BLACKWHITE)==SFX_ITEM_AVAILABLE
     708           0 :         ||rSet.GetItemState(SID_OUTPUT_QUALITY_CONTRAST)==SFX_ITEM_AVAILABLE)
     709             :     {
     710           0 :         if (mrSlideSorter.GetContentWindow())
     711             :         {
     712           0 :             sal_uLong nMode = mrSlideSorter.GetContentWindow()->GetDrawMode();
     713           0 :             sal_uInt16 nQuality = 0;
     714             : 
     715           0 :             switch (nMode)
     716             :             {
     717             :                 case ViewShell::OUTPUT_DRAWMODE_COLOR:
     718           0 :                     nQuality = 0;
     719           0 :                     break;
     720             :                 case ViewShell::OUTPUT_DRAWMODE_GRAYSCALE:
     721           0 :                     nQuality = 1;
     722           0 :                     break;
     723             :                 case ViewShell::OUTPUT_DRAWMODE_BLACKWHITE:
     724           0 :                     nQuality = 2;
     725           0 :                     break;
     726             :                 case ViewShell::OUTPUT_DRAWMODE_CONTRAST:
     727           0 :                     nQuality = 3;
     728           0 :                     break;
     729             :             }
     730             : 
     731             :             rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_COLOR,
     732           0 :                     (sal_Bool)(nQuality==0)));
     733             :             rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_GRAYSCALE,
     734           0 :                     (sal_Bool)(nQuality==1)));
     735             :             rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_BLACKWHITE,
     736           0 :                     (sal_Bool)(nQuality==2)));
     737             :             rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_CONTRAST,
     738           0 :                     (sal_Bool)(nQuality==3)));
     739             :         }
     740             :     }
     741             : 
     742           0 :     if (rSet.GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN) == SFX_ITEM_AVAILABLE)
     743             :     {
     744           0 :         rSet.Put (SfxBoolItem( SID_MAIL_SCROLLBODY_PAGEDOWN, sal_True));
     745             :     }
     746           0 : }
     747             : 
     748             : 
     749             : 
     750             : 
     751           0 : void SlideSorterController::GetStatusBarState (SfxItemSet& rSet)
     752             : {
     753           0 :     mpSlotManager->GetStatusBarState (rSet);
     754           0 : }
     755             : 
     756             : 
     757             : 
     758             : 
     759           0 : void SlideSorterController::ExecCtrl (SfxRequest& rRequest)
     760             : {
     761           0 :     mpSlotManager->ExecCtrl (rRequest);
     762           0 : }
     763             : 
     764             : 
     765             : 
     766             : 
     767           0 : void SlideSorterController::GetAttrState (SfxItemSet& rSet)
     768             : {
     769           0 :     mpSlotManager->GetAttrState (rSet);
     770           0 : }
     771             : 
     772             : 
     773             : 
     774             : 
     775           0 : void SlideSorterController::ExecStatusBar (SfxRequest& )
     776             : {
     777           0 : }
     778             : 
     779             : 
     780             : 
     781             : 
     782           0 : void SlideSorterController::UpdateAllPages (void)
     783             : {
     784             :     // Do a redraw.
     785           0 :     mrSlideSorter.GetContentWindow()->Invalidate();
     786           0 : }
     787             : 
     788             : 
     789             : 
     790             : 
     791           0 : Rectangle SlideSorterController::Resize (const Rectangle& rAvailableSpace)
     792             : {
     793           0 :     Rectangle aContentArea (rAvailableSpace);
     794             : 
     795           0 :     if (maTotalWindowArea != rAvailableSpace)
     796             :     {
     797           0 :         maTotalWindowArea = rAvailableSpace;
     798           0 :         aContentArea = Rearrange(true);
     799             :     }
     800             : 
     801           0 :     return aContentArea;
     802             : }
     803             : 
     804             : 
     805             : 
     806             : 
     807           0 : Rectangle  SlideSorterController::Rearrange (bool bForce)
     808             : {
     809           0 :     Rectangle aNewContentArea (maTotalWindowArea);
     810             : 
     811           0 :     if (aNewContentArea.IsEmpty())
     812             :         return aNewContentArea;
     813             : 
     814           0 :     if (mnModelChangeLockCount>0)
     815             :     {
     816           0 :         mbIsForcedRearrangePending |= bForce;
     817             :         return aNewContentArea;
     818             :     }
     819             :     else
     820           0 :         mbIsForcedRearrangePending = false;
     821             : 
     822           0 :     SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
     823           0 :     if (pWindow)
     824             :     {
     825           0 :         if (bForce)
     826           0 :             mrView.UpdateOrientation();
     827             : 
     828             :         // Place the scroll bars.
     829           0 :         aNewContentArea = GetScrollBarManager().PlaceScrollBars(
     830             :             maTotalWindowArea,
     831           0 :             mrView.GetOrientation() != view::Layouter::VERTICAL,
     832           0 :             mrView.GetOrientation() != view::Layouter::HORIZONTAL);
     833             : 
     834           0 :         bool bSizeHasChanged (false);
     835             :         // Only when bForce is not true we have to test for a size change in
     836             :         // order to determine whether the window and the view have to be resized.
     837           0 :         if ( ! bForce)
     838             :         {
     839           0 :             Rectangle aCurrentContentArea (pWindow->GetPosPixel(), pWindow->GetOutputSizePixel());
     840           0 :             bSizeHasChanged = (aNewContentArea != aCurrentContentArea);
     841             :         }
     842           0 :         if (bForce || bSizeHasChanged)
     843             :         {
     844             :             // The browser window gets the remaining space.
     845           0 :             pWindow->SetPosSizePixel (aNewContentArea.TopLeft(), aNewContentArea.GetSize());
     846           0 :             mrView.Resize();
     847             :         }
     848             : 
     849             :         // Adapt the scroll bars to the new zoom factor of the browser
     850             :         // window and the arrangement of the page objects.
     851           0 :         GetScrollBarManager().UpdateScrollBars(false, !bForce);
     852             : 
     853             :         // Keep the current slide in the visible area.
     854           0 :         GetVisibleAreaManager().RequestCurrentSlideVisible();
     855             : 
     856           0 :         mrView.RequestRepaint();
     857             :     }
     858             : 
     859           0 :     return aNewContentArea;
     860             : }
     861             : 
     862             : 
     863             : 
     864             : 
     865           0 : FunctionReference SlideSorterController::CreateSelectionFunction (SfxRequest& rRequest)
     866             : {
     867           0 :     FunctionReference xFunc( SelectionFunction::Create(mrSlideSorter, rRequest) );
     868           0 :     return xFunc;
     869             : }
     870             : 
     871             : 
     872             : 
     873             : 
     874           0 : ::rtl::Reference<SelectionFunction> SlideSorterController::GetCurrentSelectionFunction (void)
     875             : {
     876           0 :     FunctionReference pFunction (mrSlideSorter.GetViewShell()->GetCurrentFunction());
     877           0 :     return ::rtl::Reference<SelectionFunction>(dynamic_cast<SelectionFunction*>(pFunction.get()));
     878             : }
     879             : 
     880             : 
     881             : 
     882             : 
     883           0 : void SlideSorterController::PrepareEditModeChange (void)
     884             : {
     885             :     //  Before we throw away the page descriptors we prepare for selecting
     886             :     //  descriptors in the other mode and for restoring the current
     887             :     //  selection when switching back to the current mode.
     888           0 :     if (mrModel.GetEditMode() == EM_PAGE)
     889             :     {
     890           0 :         maSelectionBeforeSwitch.clear();
     891             : 
     892             :         // Search for the first selected page and determine the master page
     893             :         // used by its page object.  It will be selected after the switch.
     894             :         // In the same loop the current selection is stored.
     895             :         PageEnumeration aSelectedPages (
     896           0 :             PageEnumerationProvider::CreateSelectedPagesEnumeration(mrModel));
     897           0 :         while (aSelectedPages.HasMoreElements())
     898             :         {
     899           0 :             SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement());
     900           0 :             SdPage* pPage = pDescriptor->GetPage();
     901             :             // Remember the master page of the first selected descriptor.
     902           0 :             if (pPage!=NULL && mpEditModeChangeMasterPage==NULL)
     903             :                 mpEditModeChangeMasterPage = &static_cast<SdPage&>(
     904           0 :                     pPage->TRG_GetMasterPage());
     905             : 
     906           0 :             maSelectionBeforeSwitch.push_back(pPage);
     907           0 :         }
     908             : 
     909             :         // Remember the current page.
     910           0 :         if (mrSlideSorter.GetViewShell() != NULL)
     911           0 :             mnCurrentPageBeforeSwitch = (mrSlideSorter.GetViewShell()->GetViewShellBase()
     912           0 :             .GetMainViewShell()->GetActualPage()->GetPageNum()-1)/2;
     913             :     }
     914           0 : }
     915             : 
     916             : 
     917             : 
     918             : 
     919           0 : bool SlideSorterController::ChangeEditMode (EditMode eEditMode)
     920             : {
     921           0 :     bool bResult (false);
     922           0 :     if (mrModel.GetEditMode() != eEditMode)
     923             :     {
     924           0 :         ModelChangeLock aLock (*this);
     925           0 :         PreModelChange();
     926             :         // Do the actual edit mode switching.
     927           0 :         bResult = mrModel.SetEditMode(eEditMode);
     928           0 :         if (bResult)
     929           0 :             HandleModelChange();
     930             :     }
     931           0 :     return bResult;
     932             : }
     933             : 
     934             : 
     935             : 
     936             : 
     937           0 : void SlideSorterController::FinishEditModeChange (void)
     938             : {
     939           0 :     if (mrModel.GetEditMode() == EM_MASTERPAGE)
     940             :     {
     941             :         // Search for the master page that was determined in
     942             :         // PrepareEditModeChange() and make it the current page.
     943           0 :         PageEnumeration aAllPages (PageEnumerationProvider::CreateAllPagesEnumeration(mrModel));
     944           0 :         while (aAllPages.HasMoreElements())
     945             :         {
     946           0 :             SharedPageDescriptor pDescriptor (aAllPages.GetNextElement());
     947           0 :             if (pDescriptor->GetPage() == mpEditModeChangeMasterPage)
     948             :             {
     949           0 :                 GetCurrentSlideManager()->SwitchCurrentSlide(pDescriptor);
     950             :                 break;
     951             :             }
     952           0 :         }
     953             :     }
     954             :     else
     955             :     {
     956           0 :         SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(mnCurrentPageBeforeSwitch));
     957           0 :         GetCurrentSlideManager()->SwitchCurrentSlide(pDescriptor);
     958             : 
     959             :         // Restore the selection.
     960           0 :         ::std::vector<SdPage*>::iterator iPage;
     961           0 :         for (iPage=maSelectionBeforeSwitch.begin();
     962           0 :              iPage!=maSelectionBeforeSwitch.end();
     963             :              ++iPage)
     964             :         {
     965           0 :             mpPageSelector->SelectPage(*iPage);
     966             :         }
     967           0 :         maSelectionBeforeSwitch.clear( );
     968             :     }
     969           0 :     mpEditModeChangeMasterPage = NULL;
     970           0 : }
     971             : 
     972             : 
     973             : 
     974             : 
     975           0 : void SlideSorterController::PageNameHasChanged (int nPageIndex, const String& rsOldName)
     976             : {
     977             :     // Request a repaint for the page object whose name has changed.
     978           0 :     model::SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex));
     979           0 :     if (pDescriptor.get() != NULL)
     980           0 :         mrView.RequestRepaint(pDescriptor);
     981             : 
     982             :     // Get a pointer to the corresponding accessible object and notify
     983             :     // that of the name change.
     984           0 :         SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
     985           0 :         if ( ! pWindow)
     986             :             return;
     987             : 
     988             :     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
     989           0 :         xAccessible (pWindow->GetAccessible(sal_False));
     990           0 :     if ( ! xAccessible.is())
     991             :         return;
     992             : 
     993             :     // Now comes a small hack.  We assume that the accessible object is
     994             :     // an instantiation of AccessibleSlideSorterView and cast it to that
     995             :     // class.  The cleaner alternative to this cast would be a new member
     996             :     // in which we would store the last AccessibleSlideSorterView object
     997             :     // created by SlideSorterViewShell::CreateAccessibleDocumentView().
     998             :     // But then there is no guaranty that the accessible object obtained
     999             :     // from the window really is that instance last created by
    1000             :     // CreateAccessibleDocumentView().
    1001             :     // However, the dynamic cast together with the check of the result
    1002             :     // being NULL should be safe enough.
    1003             :     ::accessibility::AccessibleSlideSorterView* pAccessibleView
    1004           0 :             = dynamic_cast< ::accessibility::AccessibleSlideSorterView*>(xAccessible.get());
    1005           0 :     if (pAccessibleView == NULL)
    1006             :         return;
    1007             : 
    1008             :     ::accessibility::AccessibleSlideSorterObject* pChild
    1009           0 :             = pAccessibleView->GetAccessibleChildImplementation(nPageIndex);
    1010           0 :     if (pChild == NULL || pChild->GetPage() == NULL)
    1011             :         return;
    1012             : 
    1013           0 :     ::rtl::OUString sOldName (rsOldName);
    1014           0 :     ::rtl::OUString sNewName (pChild->GetPage()->GetName());
    1015             :     pChild->FireAccessibleEvent(
    1016             :         ::com::sun::star::accessibility::AccessibleEventId::NAME_CHANGED,
    1017             :         makeAny(sOldName),
    1018           0 :         makeAny(sNewName));
    1019             : }
    1020             : 
    1021             : 
    1022             : 
    1023             : 
    1024           0 : void SlideSorterController::SetDocumentSlides (const Reference<container::XIndexAccess>& rxSlides)
    1025             : {
    1026           0 :     if (mrModel.GetDocumentSlides() != rxSlides)
    1027             :     {
    1028           0 :         ModelChangeLock aLock (*this);
    1029           0 :         PreModelChange();
    1030             : 
    1031           0 :         mrModel.SetDocumentSlides(rxSlides);
    1032           0 :         mrView.Layout();
    1033             : 
    1034             :         // Select just the current slide.
    1035           0 :         PageSelector::BroadcastLock aBroadcastLock (*mpPageSelector);
    1036           0 :         mpPageSelector->DeselectAllPages();
    1037           0 :         mpPageSelector->SelectPage(mpCurrentSlideManager->GetCurrentSlide());
    1038             :     }
    1039           0 : }
    1040             : 
    1041             : 
    1042             : 
    1043             : 
    1044           0 : ::boost::shared_ptr<Animator> SlideSorterController::GetAnimator (void) const
    1045             : {
    1046           0 :     return mpAnimator;
    1047             : }
    1048             : 
    1049             : 
    1050             : 
    1051             : 
    1052           0 : VisibleAreaManager& SlideSorterController::GetVisibleAreaManager (void) const
    1053             : {
    1054             :     OSL_ASSERT(mpVisibleAreaManager);
    1055           0 :     return *mpVisibleAreaManager;
    1056             : }
    1057             : 
    1058             : 
    1059             : 
    1060             : 
    1061           0 : void SlideSorterController::CheckForMasterPageAssignment (void)
    1062             : {
    1063           0 :     if (mrModel.GetPageCount()%2==0)
    1064           0 :         return;
    1065           0 :     PageEnumeration aAllPages (PageEnumerationProvider::CreateAllPagesEnumeration(mrModel));
    1066           0 :     while (aAllPages.HasMoreElements())
    1067             :     {
    1068           0 :         SharedPageDescriptor pDescriptor (aAllPages.GetNextElement());
    1069           0 :         if (pDescriptor->UpdateMasterPage())
    1070             :         {
    1071             :             mrView.GetPreviewCache()->InvalidatePreviewBitmap (
    1072           0 :                 pDescriptor->GetPage(),
    1073           0 :                 true);
    1074             :         }
    1075           0 :     }
    1076             : }
    1077             : 
    1078             : 
    1079             : 
    1080             : 
    1081           0 : void SlideSorterController::CheckForSlideTransitionAssignment (void)
    1082             : {
    1083           0 :     if (mrModel.GetPageCount()%2==0)
    1084           0 :         return;
    1085           0 :     PageEnumeration aAllPages (PageEnumerationProvider::CreateAllPagesEnumeration(mrModel));
    1086           0 :     while (aAllPages.HasMoreElements())
    1087             :     {
    1088           0 :         SharedPageDescriptor pDescriptor (aAllPages.GetNextElement());
    1089           0 :         if (pDescriptor->UpdateTransitionFlag())
    1090             :         {
    1091             :             mrView.GetPreviewCache()->InvalidatePreviewBitmap (
    1092           0 :                 pDescriptor->GetPage(),
    1093           0 :                 true);
    1094             :         }
    1095           0 :     }
    1096             : }
    1097             : 
    1098             : 
    1099             : 
    1100             : 
    1101             : //===== SlideSorterController::ModelChangeLock ================================
    1102             : 
    1103           0 : SlideSorterController::ModelChangeLock::ModelChangeLock (
    1104             :     SlideSorterController& rController)
    1105           0 :     : mpController(&rController)
    1106             : {
    1107           0 :     mpController->LockModelChange();
    1108           0 : }
    1109             : 
    1110             : 
    1111             : 
    1112             : 
    1113           0 : SlideSorterController::ModelChangeLock::~ModelChangeLock (void)
    1114             : {
    1115           0 :     Release();
    1116           0 : }
    1117             : 
    1118             : 
    1119             : 
    1120             : 
    1121           0 : void SlideSorterController::ModelChangeLock::Release (void)
    1122             : {
    1123           0 :     if (mpController != NULL)
    1124             :     {
    1125           0 :         mpController->UnlockModelChange();
    1126           0 :         mpController = NULL;
    1127             :     }
    1128           0 : }
    1129             : 
    1130             : } } } // end of namespace ::sd::slidesorter
    1131             : 
    1132             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10