Resolves: rhbz#1351292 fix switching of modes in Impress

f41
David Tardon 9 years ago
parent 07914fbe26
commit ac462b9a87

@ -0,0 +1,102 @@
From b0535f3944975c1f6cdadc149d70502843331f86 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Mon, 11 Jul 2016 11:59:41 +0200
Subject: [PATCH] rhbz#1351292 correctly set edit mode
... when switching between different shells, e.g., from Outline to Slide
master.
Change-Id: I22ef6f6cac73c52fb1bedd97e653b4b57c5a7a24
---
sd/source/ui/framework/tools/FrameworkHelper.cxx | 57 +++++++++++++++++-------
1 file changed, 40 insertions(+), 17 deletions(-)
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 6b08f37..15740f0 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -518,6 +518,41 @@ OUString FrameworkHelper::GetViewURL (ViewShell::ShellType eType)
}
}
+namespace
+{
+
+void updateEditMode(const Reference<XView> &xView, FrameworkHelper* const pHelper, const EditMode eEMode, bool updateFrameView)
+{
+ // Ensure we have the expected edit mode
+ // The check is only for DrawViewShell as OutlineViewShell
+ // and SlideSorterViewShell have no master mode
+ const ::std::shared_ptr<ViewShell> pCenterViewShell (pHelper->GetViewShell(xView));
+ DrawViewShell* pDrawViewShell
+ = dynamic_cast<DrawViewShell*>(pCenterViewShell.get());
+ if (pDrawViewShell != nullptr)
+ {
+ pCenterViewShell->Broadcast (
+ ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START));
+
+ pDrawViewShell->ChangeEditMode(eEMode, pDrawViewShell->IsLayerModeActive());
+ if (updateFrameView)
+ pDrawViewShell->WriteFrameViewData();
+
+ pCenterViewShell->Broadcast (
+ ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END));
+ }
+}
+
+void asyncUpdateEditMode(FrameworkHelper* const pHelper, const EditMode eEMode)
+{
+ Reference<XResourceId> xPaneId (
+ FrameworkHelper::CreateResourceId(framework::FrameworkHelper::msCenterPaneURL));
+ Reference<XView> xView (pHelper->GetView(xPaneId));
+ updateEditMode(xView, pHelper, eEMode, true);
+}
+
+}
+
void FrameworkHelper::HandleModeChangeSlot (
sal_uLong nSlotId,
SfxRequest& rRequest)
@@ -552,7 +587,6 @@ void FrameworkHelper::HandleModeChangeSlot (
Reference<XResourceId> xPaneId (
CreateResourceId(framework::FrameworkHelper::msCenterPaneURL));
Reference<XView> xView (GetView(xPaneId));
- ::std::shared_ptr<ViewShell> pCenterViewShell (GetViewShell(xView));
// Compute requested view
OUString sRequestedView;
@@ -595,26 +629,15 @@ void FrameworkHelper::HandleModeChangeSlot (
if (!(xView.is() && xView->getResourceId()->getResourceURL().equals(sRequestedView)))
{
+ const auto xId = CreateResourceId(sRequestedView, msCenterPaneURL);
mxConfigurationController->requestResourceActivation(
- CreateResourceId(sRequestedView, msCenterPaneURL),
+ xId,
ResourceActivationMode_REPLACE);
+ RunOnResourceActivation(xId, std::bind(&asyncUpdateEditMode, this, eEMode));
}
-
- // Ensure we have the expected edit mode
- // The check is only for DrawViewShell as OutlineViewShell
- // and SlideSorterViewShell have no master mode
- DrawViewShell* pDrawViewShell
- = dynamic_cast<DrawViewShell*>(pCenterViewShell.get());
- if (pDrawViewShell != nullptr)
+ else
{
- pCenterViewShell->Broadcast (
- ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_START));
-
- pDrawViewShell->ChangeEditMode (
- eEMode, pDrawViewShell->IsLayerModeActive());
-
- pCenterViewShell->Broadcast (
- ViewShellHint(ViewShellHint::HINT_CHANGE_EDIT_MODE_END));
+ updateEditMode(xView, this, eEMode, false);
}
}
catch (RuntimeException&)
--
2.7.4

@ -239,6 +239,7 @@ Patch9: 0001-a11y-crash-on-deleting-certain-frame-in-certain-docu.patch
Patch10: 0001-Resolves-rhbz-1353069-don-t-clear-XATTR_FILL-from-st.patch
Patch11: 0001-Resolves-rhbz-1351224-wayland-grab-related-crashes.patch
Patch12: 0001-Resolves-rhbz-1352965-gtk3-infinite-clipboard-recurs.patch
Patch13: 0001-rhbz-1351292-correctly-set-edit-mode.patch
%if 0%{?rhel}
# not upstreamed
@ -2243,6 +2244,7 @@ done
%changelog
* Thu Jul 07 2016 David Tardon <dtardon@redhat.com> - 1:5.2.0.2-1
- update to 5.2.0 rc2
- Resolves: rhbz#1351292 fix switching of modes in Impress
* Tue Jun 28 2016 David Tardon <dtardon@redhat.com> - 1:5.2.0.1-2
- Resolves: rhbz#1341064 fix test on big endian systems

Loading…
Cancel
Save