[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jan 22 15:14:00 UTC 2021
sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 31 ++++++++++++++++
1 file changed, 31 insertions(+)
New commits:
commit 5fa9dcf0226a93a26dcef439c66956a93f188601
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Jan 22 11:55:06 2021 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Jan 22 16:13:24 2021 +0100
tdf#139830: keep the right context for chart after view switch (impress).
Change-Id: Ida345dd884a09b88e35e0df6f9520528c910d9d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109791
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index 9e375bc8f6c3..82d3e50371eb 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -54,6 +54,8 @@
#include <svx/svxids.hrc>
#include <vcl/EnumContext.hxx>
#include <svx/sidebar/ContextChangeEventMultiplexer.hxx>
+#include <sfx2/sidebar/SidebarController.hxx>
+#include <sfx2/sidebar/Tools.hxx>
using namespace ::sd::slidesorter;
#define ShellClass_SlideSorterViewShell
@@ -68,6 +70,24 @@ using ::vcl::EnumContext;
namespace sd { namespace slidesorter {
+namespace {
+
+bool inChartContext(sd::View* pView)
+{
+ if (!pView)
+ return false;
+
+ SfxViewShell* pViewShell = pView->GetSfxViewShell();
+ sfx2::sidebar::SidebarController* pSidebar = sfx2::sidebar::Tools::GetSidebarController(pViewShell);
+ if (pSidebar)
+ return pSidebar->hasChartContextCurrently();
+
+ return false;
+}
+
+} // anonymous namespace
+
+
SFX_IMPL_INTERFACE(SlideSorterViewShell, SfxShell)
void SlideSorterViewShell::InitInterface_Impl()
@@ -438,6 +458,17 @@ void SlideSorterViewShell::ArrangeGUIElements()
void SlideSorterViewShell::Activate (bool bIsMDIActivate)
{
+ if(inChartContext(GetView()))
+ {
+ // Avoid context changes for chart during activation / deactivation.
+ const bool bIsContextBroadcasterEnabled (SfxShell::SetContextBroadcasterEnabled(false));
+
+ ViewShell::Activate(bIsMDIActivate);
+
+ SfxShell::SetContextBroadcasterEnabled(bIsContextBroadcasterEnabled);
+ return;
+ }
+
ViewShell::Activate(bIsMDIActivate);
if (mbIsArrangeGUIElementsPending)
ArrangeGUIElements();
More information about the Libreoffice-commits
mailing list