summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-16 13:18:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-05-16 17:18:01 +0100
commit4e41e784b97a5b6f5e0cc1f5b24b816ef887b310 (patch)
tree049d3e27df5a4af3b9a627abcc79acfc846e50d5 /sd
parent51fe4d63dfdf0ea24d2fecf75d25cbe607ed1c09 (diff)
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
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/inc/SlideSorterViewShell.hxx2
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx20
2 files changed, 22 insertions, 0 deletions
diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx
index 4a9f544b2e9d..f191e73419f0 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 73cd3a84feb0..dbc53f2bc260 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() );