renaissance1: #i107215# Improved selection handling.
This commit is contained in:
@@ -168,9 +168,7 @@ void FocusManager::MoveFocus (FocusMoveDirection eDirection)
|
|||||||
|
|
||||||
if (mbPageIsFocused)
|
if (mbPageIsFocused)
|
||||||
{
|
{
|
||||||
#ifndef UNIFY_FOCUS_AND_CURRENT_PAGE
|
|
||||||
ShowFocusIndicator(GetFocusedPageDescriptor(), true);
|
ShowFocusIndicator(GetFocusedPageDescriptor(), true);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -295,7 +293,6 @@ void FocusManager::ShowFocusIndicator (
|
|||||||
const model::SharedPageDescriptor& rpDescriptor,
|
const model::SharedPageDescriptor& rpDescriptor,
|
||||||
const bool bScrollToFocus)
|
const bool bScrollToFocus)
|
||||||
{
|
{
|
||||||
#ifndef UNIFY_FOCUS_AND_CURRENT_PAGE
|
|
||||||
if (rpDescriptor.get() != NULL)
|
if (rpDescriptor.get() != NULL)
|
||||||
{
|
{
|
||||||
mrSlideSorter.GetView().SetState(rpDescriptor, model::PageDescriptor::ST_Focused, true);
|
mrSlideSorter.GetView().SetState(rpDescriptor, model::PageDescriptor::ST_Focused, true);
|
||||||
@@ -308,10 +305,11 @@ void FocusManager::ShowFocusIndicator (
|
|||||||
GetFocusedPageDescriptor()->GetBoundingBox());
|
GetFocusedPageDescriptor()->GetBoundingBox());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef UNIFY_FOCUS_AND_CURRENT_PAGE
|
||||||
mrSlideSorter.GetView().RequestRepaint (rpDescriptor);
|
mrSlideSorter.GetView().RequestRepaint (rpDescriptor);
|
||||||
|
#endif
|
||||||
NotifyFocusChangeListeners();
|
NotifyFocusChangeListeners();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -273,6 +273,14 @@ SharedPageDescriptor PageSelector::GetMostRecentlySelectedPage (void) const
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void PageSelector::SetMostRecentlySelectedPage (const model::SharedPageDescriptor& rpDescriptor)
|
||||||
|
{
|
||||||
|
mpMostRecentlySelectedPage = rpDescriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SharedPageDescriptor PageSelector::GetSelectionAnchor (void) const
|
SharedPageDescriptor PageSelector::GetSelectionAnchor (void) const
|
||||||
{
|
{
|
||||||
return mpSelectionAnchor;
|
return mpSelectionAnchor;
|
||||||
@@ -367,10 +375,16 @@ void PageSelector::UpdateCurrentPage (void)
|
|||||||
// here we store and at the end of this scope restore the
|
// here we store and at the end of this scope restore the
|
||||||
// current selection.
|
// current selection.
|
||||||
::boost::shared_ptr<PageSelection> pSelection (GetPageSelection());
|
::boost::shared_ptr<PageSelection> pSelection (GetPageSelection());
|
||||||
|
SharedPageDescriptor pRecentSelection (GetMostRecentlySelectedPage());
|
||||||
|
|
||||||
mrController.GetCurrentSlideManager()->SwitchCurrentSlide(pDescriptor);
|
mrController.GetCurrentSlideManager()->SwitchCurrentSlide(pDescriptor);
|
||||||
|
|
||||||
// Restore the selection and prevent a recursive call to
|
// Restore the selection and prevent a recursive call to
|
||||||
// UpdateCurrentPage().
|
// UpdateCurrentPage().
|
||||||
SetPageSelection(pSelection, false);
|
SetPageSelection(pSelection, false);
|
||||||
|
// Restore the most recently selected page. Important for
|
||||||
|
// making the right part of the selection visible.
|
||||||
|
mpMostRecentlySelectedPage = pRecentSelection;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -635,6 +635,10 @@ void SelectionFunction::MoveFocus (
|
|||||||
rSelector.DeselectAllPages();
|
rSelector.DeselectAllPages();
|
||||||
mrController.GetPageSelector().SelectPage(pFocusedDescriptor);
|
mrController.GetPageSelector().SelectPage(pFocusedDescriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mark the currently focused page as last selected so that it is made
|
||||||
|
// visible on the next paint.
|
||||||
|
mrController.GetPageSelector().SetMostRecentlySelectedPage(pFocusedDescriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -578,7 +578,9 @@ Rectangle SelectionManager::ResolveLargeSelection (
|
|||||||
}
|
}
|
||||||
OSL_ASSERT(pRepresentative.get() != NULL);
|
OSL_ASSERT(pRepresentative.get() != NULL);
|
||||||
|
|
||||||
return pRepresentative->GetBoundingBox();
|
return mrSlideSorter.GetView().GetLayouter().GetPageObjectBox(
|
||||||
|
pRepresentative->GetPageIndex(),
|
||||||
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -134,6 +134,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
model::SharedPageDescriptor GetMostRecentlySelectedPage (void) const;
|
model::SharedPageDescriptor GetMostRecentlySelectedPage (void) const;
|
||||||
|
|
||||||
|
/** Mark the given page as the most recently selected. Use this method
|
||||||
|
when the selection does not really change but the focus does.
|
||||||
|
*/
|
||||||
|
void SetMostRecentlySelectedPage (const model::SharedPageDescriptor& rpDescriptor);
|
||||||
|
|
||||||
/** Return the anchor for a range selection. This usually is the first
|
/** Return the anchor for a range selection. This usually is the first
|
||||||
selected page after all pages have been deselected.
|
selected page after all pages have been deselected.
|
||||||
@return
|
@return
|
||||||
|
@@ -46,6 +46,9 @@
|
|||||||
#include <tools/link.hxx>
|
#include <tools/link.hxx>
|
||||||
#include <vcl/svapp.hxx>
|
#include <vcl/svapp.hxx>
|
||||||
|
|
||||||
|
using namespace ::com::sun::star;
|
||||||
|
using namespace ::com::sun::star::uno;
|
||||||
|
|
||||||
|
|
||||||
namespace sd {
|
namespace sd {
|
||||||
|
|
||||||
@@ -301,7 +304,7 @@ void PreviewRenderer::PaintPage (const SdPage* pPage)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
mpView->CompleteRedraw (mpPreviewDevice.get(), aRegion);
|
mpView->CompleteRedraw(mpPreviewDevice.get(), aRegion);
|
||||||
}
|
}
|
||||||
catch (const ::com::sun::star::uno::Exception&)
|
catch (const ::com::sun::star::uno::Exception&)
|
||||||
{
|
{
|
||||||
@@ -416,10 +419,8 @@ void PreviewRenderer::ProvideView (DrawDocShell* pDocShell)
|
|||||||
{
|
{
|
||||||
mpView.reset (new DrawView (pDocShell, mpPreviewDevice.get(), NULL));
|
mpView.reset (new DrawView (pDocShell, mpPreviewDevice.get(), NULL));
|
||||||
}
|
}
|
||||||
mpView->SetPreviewRenderer( sal_True );
|
mpView->SetPreviewRenderer(true);
|
||||||
mpView->SetBordVisible(FALSE);
|
mpView->SetPagePaintingAllowed(false);
|
||||||
mpView->SetPageBorderVisible(TRUE);
|
|
||||||
mpView->SetPageVisible(FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user