[Libreoffice-commits] core.git: sd/source
Caolán McNamara
caolanm at redhat.com
Mon May 16 16:18:22 UTC 2016
sd/source/ui/inc/SlideSorterViewShell.hxx | 2 +
sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 20 ++++++++++++++++
2 files changed, 22 insertions(+)
New commits:
commit 4e41e784b97a5b6f5e0cc1f5b24b816ef887b310
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 16 13:18:06 2016 +0100
Resolves: tdf#99523 exit text edit and unmark objects before moving slide
otherwise correct undo isn't recorded for moving the slides
Change-Id: I08338a413f10242c4bdf92a73d504f125bc26631
diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx
index 4a9f544..f191e73 100644
--- a/sd/source/ui/inc/SlideSorterViewShell.hxx
+++ b/sd/source/ui/inc/SlideSorterViewShell.hxx
@@ -220,6 +220,8 @@ private:
virtual void UpdateScrollBars() override;
void PostMoveSlidesActions(const std::shared_ptr<SlideSorterViewShell::PageSelection> &rpSelection);
+
+ void MainViewEndEditAndUnmarkAll();
};
typedef std::shared_ptr<SlideSorterViewShell::PageSelection> SharedPageSelection;
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index 73cd3a8..dbc53f2 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -700,8 +700,22 @@ void SlideSorterViewShell::RemoveSelectionChangeListener (
mpSlideSorter->GetController().GetSelectionManager()->RemoveSelectionChangeListener(rCallback);
}
+void SlideSorterViewShell::MainViewEndEditAndUnmarkAll()
+{
+ std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell();
+ DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get());
+ SdrView* pView = pDrawViewShell ? pDrawViewShell->GetDrawView() : nullptr;
+ if (pView)
+ {
+ pView->SdrEndTextEdit();
+ pView->UnmarkAll();
+ }
+}
+
void SlideSorterViewShell::ExecMovePageFirst (SfxRequest& /*rReq*/)
{
+ MainViewEndEditAndUnmarkAll();
+
// SdDrawDocument MovePages is based on SdPage IsSelected, so
// transfer the SlideSorter selection to SdPages (*it)
std::shared_ptr<SlideSorterViewShell::PageSelection> pSelection ( GetPageSelection() );
@@ -749,6 +763,8 @@ void SlideSorterViewShell::GetStateMovePageFirst (SfxItemSet& rSet)
void SlideSorterViewShell::ExecMovePageUp (SfxRequest& /*rReq*/)
{
+ MainViewEndEditAndUnmarkAll();
+
sal_uInt16 firstSelectedPageNo = SAL_MAX_UINT16;
sal_uInt16 pageNo;
// SdDrawDocument MovePages is based on SdPage IsSelected, so
@@ -781,6 +797,8 @@ void SlideSorterViewShell::GetStateMovePageUp (SfxItemSet& rSet)
void SlideSorterViewShell::ExecMovePageDown (SfxRequest& /*rReq*/)
{
+ MainViewEndEditAndUnmarkAll();
+
sal_uInt16 lastSelectedPageNo = 0;
sal_uInt16 pageNo;
// SdDrawDocument MovePages is based on SdPage IsSelected, so
@@ -815,6 +833,8 @@ void SlideSorterViewShell::GetStateMovePageDown (SfxItemSet& rSet)
void SlideSorterViewShell::ExecMovePageLast (SfxRequest& /*rReq*/)
{
+ MainViewEndEditAndUnmarkAll();
+
// SdDrawDocument MovePages is based on SdPage IsSelected, so
// transfer the SlideSorter selection to SdPages (*it)
std::shared_ptr<SlideSorterViewShell::PageSelection> pSelection ( GetPageSelection() );
More information about the Libreoffice-commits
mailing list