summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-12-16 11:45:17 +0000
committerMichael Meeks <michael.meeks@collabora.com>2019-12-16 17:29:58 +0000
commitb35e97f75c1093db3516b74b637c16c5dc8e43a2 (patch)
tree34b4e3675a1d586b0aff96c1a7187de0275f15be /sfx2
parent08f3691996ed7dd4d7bc7c641000e46c6bc00bfc (diff)
Revert "jsdialogs: emit JSON at idle to avoid repeated emission."
This reverts commit 7d9932ade30464abf297f2e3c3690cca68d6bf71.
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/Deck.cxx42
1 files changed, 12 insertions, 30 deletions
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index e185e726157a..91ff5dc340a6 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -44,35 +44,8 @@
using namespace css;
using namespace css::uno;
-
namespace sfx2 { namespace sidebar {
-class DeckNotifyIdle : public Idle
-{
- Deck &mrDeck;
-public:
- DeckNotifyIdle(Deck &rDeck) :
- Idle("Deck notify"),
- mrDeck(rDeck)
- {
- SetPriority(TaskPriority::POST_PAINT);
- }
- void Invoke() override
- {
- auto pNotifier = mrDeck.GetLOKNotifier();
- try
- {
- std::stringstream aStream;
- boost::property_tree::write_json(aStream, mrDeck.DumpAsPropertyTree());
- pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, aStream.str().c_str());
- }
- catch(boost::property_tree::json_parser::json_parser_error& rError)
- {
- SAL_WARN("sfx.sidebar", rError.message());
- }
- }
-};
-
Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow,
const std::function<void()>& rCloserAction)
: Window(pParentWindow, 0)
@@ -80,7 +53,6 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow,
, mnMinimalWidth(0)
, mnMinimalHeight(0)
, maPanels()
- , mpIdleNotify(new DeckNotifyIdle(*this))
, mpTitleBar(VclPtr<DeckTitleBar>::Create(rDeckDescriptor.msTitle, this, rCloserAction))
, mpScrollClipWindow(VclPtr<vcl::Window>::Create(this))
, mpScrollContainer(VclPtr<ScrollContainerWindow>::Create(mpScrollClipWindow.get()))
@@ -210,11 +182,21 @@ void Deck::Resize()
{
Window::Resize();
+ const vcl::ILibreOfficeKitNotifier *pNotifier;
if (comphelper::LibreOfficeKit::isActive() &&
comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()) &&
- GetLOKNotifier())
+ (pNotifier = GetLOKNotifier()))
{
- mpIdleNotify->Start();
+ try
+ {
+ std::stringstream aStream;
+ boost::property_tree::write_json(aStream, DumpAsPropertyTree());
+ pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, aStream.str().c_str());
+ }
+ catch(boost::property_tree::json_parser::json_parser_error& rError)
+ {
+ SAL_WARN("sfx.sidebar", rError.message());
+ }
}
}