Kaydet (Commit) 49fe72fe authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Jan Holesovsky

sfx2: LOK: route the parent sidebar window instead of the deck

Change-Id: I0269a67c637afbc63a81405918f620009e681ff6
üst fcafc6d7
...@@ -37,11 +37,14 @@ public: ...@@ -37,11 +37,14 @@ public:
virtual ~SidebarDockingWindow() override; virtual ~SidebarDockingWindow() override;
virtual void dispose() override; virtual void dispose() override;
void NotifyResize();
using SfxDockingWindow::Close; using SfxDockingWindow::Close;
protected: protected:
// Window overridables // Window overridables
virtual void GetFocus() override; virtual void GetFocus() override;
virtual void Resize() override;
virtual SfxChildAlignment CheckAlignment ( virtual SfxChildAlignment CheckAlignment (
SfxChildAlignment eCurrentAlignment, SfxChildAlignment eCurrentAlignment,
......
...@@ -62,20 +62,6 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow, ...@@ -62,20 +62,6 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow,
mpVerticalScrollBar->SetScrollHdl(LINK(this, Deck, HandleVerticalScrollBarChange)); 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 #ifdef DEBUG
SetText(OUString("Deck")); SetText(OUString("Deck"));
mpScrollClipWindow->SetText(OUString("ScrollClipWindow")); mpScrollClipWindow->SetText(OUString("ScrollClipWindow"));
...@@ -186,15 +172,6 @@ bool Deck::EventNotify(NotifyEvent& rEvent) ...@@ -186,15 +172,6 @@ bool Deck::EventNotify(NotifyEvent& rEvent)
void Deck::Resize() void Deck::Resize()
{ {
Window::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) bool Deck::ProcessWheelEvent(CommandEvent const * pCommandEvent)
...@@ -247,15 +224,6 @@ void Deck::RequestLayout() ...@@ -247,15 +224,6 @@ void Deck::RequestLayout()
DeckLayouter::LayoutDeck(GetContentArea(), mnMinimalWidth, maPanels, DeckLayouter::LayoutDeck(GetContentArea(), mnMinimalWidth, maPanels,
*GetTitleBar(), *mpScrollClipWindow, *mpScrollContainer, *GetTitleBar(), *mpScrollClipWindow, *mpScrollContainer,
*mpFiller, *mpVerticalScrollBar); *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() vcl::Window* Deck::GetPanelParentWindow()
...@@ -301,15 +269,6 @@ void Deck::ShowPanel(const Panel& rPanel) ...@@ -301,15 +269,6 @@ void Deck::ShowPanel(const Panel& rPanel)
Point( Point(
mpScrollContainer->GetPosPixel().X(), mpScrollContainer->GetPosPixel().X(),
-nNewThumbPos)); -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);
}
} }
} }
......
...@@ -406,6 +406,8 @@ void SidebarController::NotifyResize() ...@@ -406,6 +406,8 @@ void SidebarController::NotifyResize()
} }
RestrictWidth(nMinimalWidth); RestrictWidth(nMinimalWidth);
mpParentWindow->NotifyResize();
} }
void SidebarController::ProcessNewWidth (const sal_Int32 nNewWidth) void SidebarController::ProcessNewWidth (const sal_Int32 nNewWidth)
......
...@@ -20,9 +20,11 @@ ...@@ -20,9 +20,11 @@
#include <sfx2/sidebar/SidebarChildWindow.hxx> #include <sfx2/sidebar/SidebarChildWindow.hxx>
#include <sfx2/sidebar/SidebarController.hxx> #include <sfx2/sidebar/SidebarController.hxx>
#include <sfx2/lokhelper.hxx>
#include <sfx2/bindings.hxx> #include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx> #include <sfx2/dispatch.hxx>
#include <tools/link.hxx> #include <tools/link.hxx>
#include <comphelper/lok.hxx>
using namespace css; using namespace css;
using namespace css::uno; using namespace css::uno;
...@@ -77,6 +79,34 @@ void SidebarDockingWindow::GetFocus() ...@@ -77,6 +79,34 @@ void SidebarDockingWindow::GetFocus()
SfxDockingWindow::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 SidebarDockingWindow::CheckAlignment (
SfxChildAlignment eCurrentAlignment, SfxChildAlignment eCurrentAlignment,
SfxChildAlignment eRequestedAlignment) SfxChildAlignment eRequestedAlignment)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment