diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-10-10 06:44:27 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-04-30 18:06:24 +0200 |
commit | 49fe72fe93d6b292da275fd0508a01b49a86fa3b (patch) | |
tree | e4c04c9b69901a05b3adeab38a6857a469d9ac90 | |
parent | fcafc6d737b26b5c0fc7b6f61356fa4290cd15f8 (diff) |
sfx2: LOK: route the parent sidebar window instead of the deck
Change-Id: I0269a67c637afbc63a81405918f620009e681ff6
-rw-r--r-- | include/sfx2/sidebar/SidebarDockingWindow.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/sidebar/Deck.cxx | 41 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarDockingWindow.cxx | 30 |
4 files changed, 35 insertions, 41 deletions
diff --git a/include/sfx2/sidebar/SidebarDockingWindow.hxx b/include/sfx2/sidebar/SidebarDockingWindow.hxx index 0a0a55c76c5e..220b17ebdb2b 100644 --- a/include/sfx2/sidebar/SidebarDockingWindow.hxx +++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx @@ -37,11 +37,14 @@ public: virtual ~SidebarDockingWindow() override; virtual void dispose() override; + void NotifyResize(); + using SfxDockingWindow::Close; protected: // Window overridables virtual void GetFocus() override; + virtual void Resize() override; virtual SfxChildAlignment CheckAlignment ( SfxChildAlignment eCurrentAlignment, diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index ba6ac1f36c95..b3ab0d22ad84 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -62,20 +62,6 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow, mpVerticalScrollBar->SetScrollHdl(LINK(this, Deck, HandleVerticalScrollBarChange)); - if (comphelper::LibreOfficeKit::isActive()) - { - SetLOKNotifier(SfxViewShell::Current()); - - if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) - { - std::vector<vcl::LOKPayloadItem> aItems; - aItems.emplace_back("type", "deck"); - aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); - aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); - pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems); - } - } - #ifdef DEBUG SetText(OUString("Deck")); mpScrollClipWindow->SetText(OUString("ScrollClipWindow")); @@ -186,15 +172,6 @@ bool Deck::EventNotify(NotifyEvent& rEvent) void Deck::Resize() { Window::Resize(); - - if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) - { - std::vector<vcl::LOKPayloadItem> aItems; - aItems.emplace_back("type", "deck"); - aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); - aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); - pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems); - } } bool Deck::ProcessWheelEvent(CommandEvent const * pCommandEvent) @@ -247,15 +224,6 @@ void Deck::RequestLayout() DeckLayouter::LayoutDeck(GetContentArea(), mnMinimalWidth, maPanels, *GetTitleBar(), *mpScrollClipWindow, *mpScrollContainer, *mpFiller, *mpVerticalScrollBar); - - if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) - { - std::vector<vcl::LOKPayloadItem> aItems; - aItems.emplace_back("type", "deck"); - aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); - aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); - pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems); - } } vcl::Window* Deck::GetPanelParentWindow() @@ -301,15 +269,6 @@ void Deck::ShowPanel(const Panel& rPanel) Point( mpScrollContainer->GetPosPixel().X(), -nNewThumbPos)); - - if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) - { - std::vector<vcl::LOKPayloadItem> aItems; - aItems.emplace_back("type", "deck"); - aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); - aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); - pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems); - } } } diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 805d25799121..43804ba3271a 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -406,6 +406,8 @@ void SidebarController::NotifyResize() } RestrictWidth(nMinimalWidth); + + mpParentWindow->NotifyResize(); } void SidebarController::ProcessNewWidth (const sal_Int32 nNewWidth) diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index 84a2834e5a34..270234d8ddd1 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -20,9 +20,11 @@ #include <sfx2/sidebar/SidebarChildWindow.hxx> #include <sfx2/sidebar/SidebarController.hxx> +#include <sfx2/lokhelper.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> #include <tools/link.hxx> +#include <comphelper/lok.hxx> using namespace css; using namespace css::uno; @@ -77,6 +79,34 @@ void SidebarDockingWindow::GetFocus() SfxDockingWindow::GetFocus(); } +void SidebarDockingWindow::Resize() +{ + SfxDockingWindow::Resize(); + + NotifyResize(); +} + +void SidebarDockingWindow::NotifyResize() +{ + SAL_WARN("sw", "SfxDockingWindow::Resize: " << (long)SfxViewShell::Current()); + if (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current()) + { + SAL_WARN("sw", "SfxDockingWindow::Resize: Creating!"); + if (!GetLOKNotifier()) + SetLOKNotifier(SfxViewShell::Current()); + + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + { + std::vector<vcl::LOKPayloadItem> aItems; + aItems.emplace_back("type", "deck"); + aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); + aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); + pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems); + SAL_WARN("sw", "SfxDockingWindow::Resize: Created!"); + } + } +} + SfxChildAlignment SidebarDockingWindow::CheckAlignment ( SfxChildAlignment eCurrentAlignment, SfxChildAlignment eRequestedAlignment) |