summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-12-19 11:16:15 +0000
committerMichael Meeks <michael.meeks@collabora.com>2019-12-19 12:53:14 +0000
commit2d90583fb9026b3c8ee466029423dad3e957eb7e (patch)
tree7cbda326ba156775558f05f5b3da3a9eb16754c9 /sfx2
parent904e0583d6918a78a88cd73772e2e3e2e32de59a (diff)
sidebar: bring new sidebar commands in-house & be more assertive with sfx2
Force the sidebar to do it's asynchronous things synchronously to help keep things sane. Also emit our (in-process on Android / iOS) context change notification after everyone else got it & updated their panels. Change-Id: If94de6c83f1b783d7deee515fc2ee9a8d3754765
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/AsynchronousCall.cxx8
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx7
-rw-r--r--sfx2/source/sidebar/SidebarDockingWindow.cxx6
3 files changed, 21 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/AsynchronousCall.cxx b/sfx2/source/sidebar/AsynchronousCall.cxx
index 495d62f8eb7b..0013ea5e5ceb 100644
--- a/sfx2/source/sidebar/AsynchronousCall.cxx
+++ b/sfx2/source/sidebar/AsynchronousCall.cxx
@@ -57,6 +57,14 @@ void AsynchronousCall::CancelRequest()
}
}
+void AsynchronousCall::Sync()
+{
+ if (mnCallId != nullptr) {
+ maAction();
+ CancelRequest();
+ }
+}
+
IMPL_LINK_NOARG(AsynchronousCall, HandleUserCall, void*, void )
{
mnCallId = nullptr;
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 72d6d216c5a2..91405791c727 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -498,6 +498,13 @@ void SidebarController::ProcessNewWidth (const sal_Int32 nNewWidth)
}
}
+void SidebarController::SyncUpdate()
+{
+ maPropertyChangeForwarder.Sync();
+ maContextChangeUpdate.Sync();
+ maAsynchronousDeckSwitch.Sync();
+}
+
void SidebarController::UpdateConfigurations()
{
if (maCurrentContext == maRequestedContext
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 5facecb2deb3..2bf4ea7258bb 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -182,6 +182,12 @@ void SidebarDockingWindow::Resize()
NotifyResize();
}
+void SidebarDockingWindow::SyncUpdate()
+{
+ if (mpSidebarController.is())
+ mpSidebarController->SyncUpdate();
+}
+
void SidebarDockingWindow::NotifyResize()
{
if (comphelper::LibreOfficeKit::isActive() && mpSidebarController.is() && SfxViewShell::Current())