renaissance1: #i107215# Improved selection handling.
This commit is contained in:
parent
b237fdf1e2
commit
f5d2c01dda
@ -168,9 +168,7 @@ void FocusManager::MoveFocus (FocusMoveDirection eDirection)
|
||||
|
||||
if (mbPageIsFocused)
|
||||
{
|
||||
#ifndef UNIFY_FOCUS_AND_CURRENT_PAGE
|
||||
ShowFocusIndicator(GetFocusedPageDescriptor(), true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -295,7 +293,6 @@ void FocusManager::ShowFocusIndicator (
|
||||
const model::SharedPageDescriptor& rpDescriptor,
|
||||
const bool bScrollToFocus)
|
||||
{
|
||||
#ifndef UNIFY_FOCUS_AND_CURRENT_PAGE
|
||||
if (rpDescriptor.get() != NULL)
|
||||
{
|
||||
mrSlideSorter.GetView().SetState(rpDescriptor, model::PageDescriptor::ST_Focused, true);
|
||||
@ -308,10 +305,11 @@ void FocusManager::ShowFocusIndicator (
|
||||
GetFocusedPageDescriptor()->GetBoundingBox());
|
||||
}
|
||||
|
||||
#ifndef UNIFY_FOCUS_AND_CURRENT_PAGE
|
||||
mrSlideSorter.GetView().RequestRepaint (rpDescriptor);
|
||||
#endif
|
||||
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
|
||||
{
|
||||
return mpSelectionAnchor;
|
||||
@ -367,10 +375,16 @@ void PageSelector::UpdateCurrentPage (void)
|
||||
// here we store and at the end of this scope restore the
|
||||
// current selection.
|
||||
::boost::shared_ptr<PageSelection> pSelection (GetPageSelection());
|
||||
SharedPageDescriptor pRecentSelection (GetMostRecentlySelectedPage());
|
||||
|
||||
mrController.GetCurrentSlideManager()->SwitchCurrentSlide(pDescriptor);
|
||||
|
||||
// Restore the selection and prevent a recursive call to
|
||||
// UpdateCurrentPage().
|
||||
SetPageSelection(pSelection, false);
|
||||
// Restore the most recently selected page. Important for
|
||||
// making the right part of the selection visible.
|
||||
mpMostRecentlySelectedPage = pRecentSelection;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -635,6 +635,10 @@ void SelectionFunction::MoveFocus (
|
||||
rSelector.DeselectAllPages();
|
||||
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);
|
||||
|
||||
return pRepresentative->GetBoundingBox();
|
||||
return mrSlideSorter.GetView().GetLayouter().GetPageObjectBox(
|
||||
pRepresentative->GetPageIndex(),
|
||||
true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -134,6 +134,11 @@ public:
|
||||
*/
|
||||
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
|
||||
selected page after all pages have been deselected.
|
||||
@return
|
||||
|
@ -46,6 +46,9 @@
|
||||
#include <tools/link.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
using namespace ::com::sun::star::uno;
|
||||
|
||||
|
||||
namespace sd {
|
||||
|
||||
@ -301,7 +304,7 @@ void PreviewRenderer::PaintPage (const SdPage* pPage)
|
||||
|
||||
try
|
||||
{
|
||||
mpView->CompleteRedraw (mpPreviewDevice.get(), aRegion);
|
||||
mpView->CompleteRedraw(mpPreviewDevice.get(), aRegion);
|
||||
}
|
||||
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->SetPreviewRenderer( sal_True );
|
||||
mpView->SetBordVisible(FALSE);
|
||||
mpView->SetPageBorderVisible(TRUE);
|
||||
mpView->SetPageVisible(FALSE);
|
||||
mpView->SetPreviewRenderer(true);
|
||||
mpView->SetPagePaintingAllowed(false);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user