SlsPageSelector.cxx (b862c97c) SlsPageSelector.cxx (4799f5ba)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 51 unchanged lines hidden (view full) ---

60 mrController(mrSlideSorter.GetController()),
61 mnSelectedPageCount(0),
62 mnBroadcastDisableLevel(0),
63 mbSelectionChangeBroadcastPending(false),
64 mpMostRecentlySelectedPage(),
65 mpSelectionAnchor(),
66 mpCurrentPage(),
67 mnUpdateLockCount(0),
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 51 unchanged lines hidden (view full) ---

60 mrController(mrSlideSorter.GetController()),
61 mnSelectedPageCount(0),
62 mnBroadcastDisableLevel(0),
63 mbSelectionChangeBroadcastPending(false),
64 mpMostRecentlySelectedPage(),
65 mpSelectionAnchor(),
66 mpCurrentPage(),
67 mnUpdateLockCount(0),
68 mbIsUpdateCurrentPagePending(false)
68 mbIsUpdateCurrentPagePending(true)
69{
70 CountSelectedPages ();
71}
72
73
74
75
76void PageSelector::SelectAllPages (void)

--- 311 unchanged lines hidden (view full) ---

388 }
389
390 if ( ! mbIsUpdateCurrentPagePending && bUpdateOnlyWhenPending)
391 return;
392
393 mbIsUpdateCurrentPagePending = false;
394
395 // Make the first selected page the current page.
69{
70 CountSelectedPages ();
71}
72
73
74
75
76void PageSelector::SelectAllPages (void)

--- 311 unchanged lines hidden (view full) ---

388 }
389
390 if ( ! mbIsUpdateCurrentPagePending && bUpdateOnlyWhenPending)
391 return;
392
393 mbIsUpdateCurrentPagePending = false;
394
395 // Make the first selected page the current page.
396 SharedPageDescriptor pCurrentPageDescriptor;
396 const sal_Int32 nPageCount (GetPageCount());
397 for (sal_Int32 nIndex=0; nIndex<nPageCount; ++nIndex)
398 {
399 SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nIndex));
397 const sal_Int32 nPageCount (GetPageCount());
398 for (sal_Int32 nIndex=0; nIndex<nPageCount; ++nIndex)
399 {
400 SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nIndex));
400 if (pDescriptor && pDescriptor->HasState(PageDescriptor::ST_Selected))
401 if ( ! pDescriptor)
402 continue;
403 if (pDescriptor->HasState(PageDescriptor::ST_Selected))
401 {
404 {
402 // Switching the current slide normally sets also the selection
403 // to just the new current slide. To prevent that, we store
404 // (and at the end of this scope restore) the current selection.
405 ::boost::shared_ptr<PageSelection> pSelection (GetPageSelection());
406
407 mrController.GetCurrentSlideManager()->SwitchCurrentSlide(pDescriptor);
408
409 // Restore the selection and prevent a recursive call to
410 // UpdateCurrentPage().
411 SetPageSelection(pSelection, false);
412 return;
405 pCurrentPageDescriptor = pDescriptor;
406 break;
413 }
414 }
407 }
408 }
409 if ( ! pCurrentPageDescriptor && nPageCount>0)
410 {
411 // No page is selected. Make the first slide the current page.
412 pCurrentPageDescriptor = mrModel.GetPageDescriptor(0);
413 }
415
414
416 // No page is selected. Do not change the current slide.
415 if (pCurrentPageDescriptor)
416 {
417 // Switching the current slide normally sets also the
418 // selection to just the new current slide. To prevent that,
419 // we store (and at the end of this scope restore) the current
420 // selection.
421 ::boost::shared_ptr<PageSelection> pSelection (GetPageSelection());
422
423 mrController.GetCurrentSlideManager()->SwitchCurrentSlide(pCurrentPageDescriptor);
424
425 // Restore the selection and prevent a recursive call to
426 // UpdateCurrentPage().
427 SetPageSelection(pSelection, false);
428 }
417}
418
419
420
421
422//===== PageSelector::UpdateLock ==============================================
423
424PageSelector::UpdateLock::UpdateLock (SlideSorter& rSlideSorter)

--- 64 unchanged lines hidden ---
429}
430
431
432
433
434//===== PageSelector::UpdateLock ==============================================
435
436PageSelector::UpdateLock::UpdateLock (SlideSorter& rSlideSorter)

--- 64 unchanged lines hidden ---