[Libreoffice-commits] core.git: 2 commits - include/sfx2 sfx2/source
Ashod Nakashian (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jul 26 09:46:39 UTC 2019
include/sfx2/sidebar/SidebarChildWindow.hxx | 5 +++++
include/sfx2/sidebar/SidebarDockingWindow.hxx | 2 ++
sfx2/source/sidebar/SidebarChildWindow.cxx | 3 ++-
sfx2/source/sidebar/SidebarController.cxx | 5 -----
sfx2/source/sidebar/SidebarDockingWindow.cxx | 12 ++++++++----
5 files changed, 17 insertions(+), 10 deletions(-)
New commits:
commit e054cfb3538fec4992ab28627a26aa23b6c4fbb7
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Thu Oct 25 01:35:37 2018 -0400
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jul 26 11:45:54 2019 +0200
LOK: sidebar: enable only for Impress in LOK
Change-Id: Idb361164db9ea8681b45fe99608d2cb5690db161
Reviewed-on: https://gerrit.libreoffice.org/73511
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/sfx2/sidebar/SidebarChildWindow.hxx b/include/sfx2/sidebar/SidebarChildWindow.hxx
index 1fcb25431d94..e37cf443ec86 100644
--- a/include/sfx2/sidebar/SidebarChildWindow.hxx
+++ b/include/sfx2/sidebar/SidebarChildWindow.hxx
@@ -39,6 +39,11 @@ public:
SFX_DECL_CHILDWINDOW_WITHID(SidebarChildWindow);
static sal_Int32 GetDefaultWidth(vcl::Window const * pWindow);
+
+ bool IsSidebarVisibleInLOK() const { return mbSidebarVisibleInLOK; }
+
+private:
+ const bool mbSidebarVisibleInLOK;
};
diff --git a/include/sfx2/sidebar/SidebarDockingWindow.hxx b/include/sfx2/sidebar/SidebarDockingWindow.hxx
index a0da550a020b..5e54f00b53ad 100644
--- a/include/sfx2/sidebar/SidebarDockingWindow.hxx
+++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx
@@ -63,6 +63,8 @@ private:
std::unique_ptr<svt::AcceleratorExecute> mpAccel;
void DoDispose();
+
+ const bool mbSidebarVisibleInLOK;
};
} } // end of namespace sfx2::sidebar
diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx b/sfx2/source/sidebar/SidebarChildWindow.cxx
index 0e5e73bbfdf5..e84d2fb4b379 100644
--- a/sfx2/source/sidebar/SidebarChildWindow.cxx
+++ b/sfx2/source/sidebar/SidebarChildWindow.cxx
@@ -32,7 +32,8 @@ SFX_IMPL_DOCKINGWINDOW_WITHID(SidebarChildWindow, SID_SIDEBAR);
SidebarChildWindow::SidebarChildWindow (vcl::Window* pParentWindow, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo* pInfo)
- : SfxChildWindow(pParentWindow, nId)
+ : SfxChildWindow(pParentWindow, nId),
+ mbSidebarVisibleInLOK(pInfo && pInfo->aModule == "simpress")
{
SetWindow(VclPtr<SidebarDockingWindow>::Create(pBindings, *this, pParentWindow,
WB_STDDOCKWIN | WB_OWNERDRAWDECORATION |
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index dfc3d296068d..834bb59f26bb 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -42,6 +42,7 @@ SidebarDockingWindow::SidebarDockingWindow(SfxBindings* pSfxBindings, SidebarChi
: SfxDockingWindow(pSfxBindings, &rChildWindow, pParentWindow, nBits)
, mpSidebarController()
, mbIsReadyToDrag(false)
+ , mbSidebarVisibleInLOK(rChildWindow.IsSidebarVisibleInLOK())
{
// Get the XFrame from the bindings.
if (pSfxBindings==nullptr || pSfxBindings->GetDispatcher()==nullptr)
@@ -110,7 +111,7 @@ void SidebarDockingWindow::Resize()
void SidebarDockingWindow::NotifyResize()
{
- if (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current())
+ if (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() && mbSidebarVisibleInLOK)
{
if (!GetLOKNotifier())
SetLOKNotifier(SfxViewShell::Current());
commit 82518f1235aea055a6283bb6ce6a8a640959b564
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sat Oct 27 10:36:51 2018 -0400
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jul 26 11:45:41 2019 +0200
LOK: sidebar: send close notification on disposing sidebar
Change-Id: Ia8f197d07ba4b6a089571e9ca23b4697d04e7734
Reviewed-on: https://gerrit.libreoffice.org/73510
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 1855b65e61fc..6b3bcc025e0d 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1118,11 +1118,6 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, Menu*, pMenu, bool)
void SidebarController::RequestCloseDeck()
{
- if (comphelper::LibreOfficeKit::isActive())
- {
- mpCurrentDeck->GetLOKNotifier()->notifyWindow(mpCurrentDeck->GetLOKWindowId(), "close");
- }
-
mbIsDeckRequestedOpen = false;
UpdateDeckOpenState();
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index baba39d49ea3..dfc3d296068d 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -70,6 +70,12 @@ void SidebarDockingWindow::dispose()
void SidebarDockingWindow::DoDispose()
{
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+ pNotifier->notifyWindow(GetLOKWindowId(), "close");
+ }
+
Reference<lang::XComponent> xComponent (static_cast<XWeak*>(mpSidebarController.get()), UNO_QUERY);
mpSidebarController.clear();
if (xComponent.is())
@@ -104,10 +110,8 @@ void SidebarDockingWindow::Resize()
void SidebarDockingWindow::NotifyResize()
{
- SAL_WARN("sw", "SfxDockingWindow::Resize: " << reinterpret_cast<sal_IntPtr>(SfxViewShell::Current()));
if (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current())
{
- SAL_WARN("sw", "SfxDockingWindow::Resize: Creating!");
if (!GetLOKNotifier())
SetLOKNotifier(SfxViewShell::Current());
@@ -118,7 +122,6 @@ void SidebarDockingWindow::NotifyResize()
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!");
}
}
}
More information about the Libreoffice-commits
mailing list