summaryrefslogtreecommitdiff
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 11:45:17 +0000
commitb518264708d56ceb392cdd1aa567d3cd2941ebec (patch)
treebad916473080d58523e0953fd7e6f8e46b90e073
parent05f82d1ae7410fb256a9b5eec3610979aa05a47e (diff)
Revert "jsdialogs: emit JSON at idle to avoid repeated emission."
This reverts commit 7d9932ade30464abf297f2e3c3690cca68d6bf71.
-rw-r--r--include/sfx2/sidebar/Deck.hxx2
-rw-r--r--sfx2/source/sidebar/Deck.cxx42
2 files changed, 12 insertions, 32 deletions
diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index 278bb4f49a01..65b44d7efc11 100644
--- a/include/sfx2/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -29,7 +29,6 @@ namespace sfx2 { namespace sidebar {
class DeckDescriptor;
class DeckTitleBar;
-class DeckNotifyIdle;
/** This is the parent window of the panels.
It displays the deck title.
@@ -89,7 +88,6 @@ private:
sal_Int32 mnMinimalWidth;
sal_Int32 mnMinimalHeight;
SharedPanelContainer maPanels;
- std::unique_ptr<DeckNotifyIdle> mpIdleNotify;
VclPtr<DeckTitleBar> mpTitleBar;
VclPtr<vcl::Window> mpScrollClipWindow;
VclPtr<ScrollContainerWindow> mpScrollContainer;
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());
+ }
}
}