[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/vcl sfx2/source vcl/source

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 10 12:15:32 UTC 2019


 include/vcl/window.hxx        |    1 +
 sfx2/source/view/viewfrm.cxx  |    5 +++--
 sfx2/source/view/viewsh.cxx   |   11 ++++++++---
 vcl/source/window/window2.cxx |    6 ++++++
 4 files changed, 18 insertions(+), 5 deletions(-)

New commits:
commit 95801714f4159cbbe5fc4249dc6af037fd716f7e
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sat Nov 30 09:36:27 2019 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Dec 10 13:14:55 2019 +0100

    lok: fix welded dialogs
    
    In the tiled rendering case the dialogs, run asynchronous due
    to multiple user access. In order to send the messages
    to the client side, the dialog  has to hook
    a LOKNotifier in the constructor of the SfxViewShell.
    
    However, the new weld wrapper classes use the Frame Window,
    (i.e. Window::GetFarmeWeld()), as a parent of the dialogs.
    
    On the other hand, in order to avoid getting the interface
    implementation inside implementation classes, it has been
    created a new method Window::GetFrameWindow(), otherwise
    I have to do a bureaucratic conversion between Interfaces
    to Implementations ( i.e. UnoWrapperBase::GetUnoWrapper() )
    
    Change-Id: I32c34d82a89211a025250e65a05ce47d30efa0b8
    Reviewed-on: https://gerrit.libreoffice.org/84117
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 39e64ed22aae..f95ad05cef5b 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -556,6 +556,7 @@ public:
 
     SAL_DLLPRIVATE vcl::Window*         ImplGetFrameWindow() const;
     weld::Window*                       GetFrameWeld() const;
+    vcl::Window*                        GetFrameWindow() const;
     SalFrame*                           ImplGetFrame() const;
     SAL_DLLPRIVATE ImplFrameData*       ImplGetFrameData();
 
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 1f16a65973d3..80573aa61fc8 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1376,8 +1376,9 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
 
             case SfxHintId::Deinitializing:
             {
-                if (GetWindow().GetLOKNotifier())
-                    GetWindow().ReleaseLOKNotifier();
+                vcl::Window* pFrameWin = GetWindow().GetFrameWindow();
+                if (pFrameWin && pFrameWin->GetLOKNotifier())
+                    pFrameWin->ReleaseLOKNotifier();
 
                 GetFrame().DoClose();
                 break;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index f8ffb6ddae1c..7e2ec6369e58 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1080,7 +1080,11 @@ SfxViewShell::SfxViewShell
     rViewArr.push_back(this);
 
     if (comphelper::LibreOfficeKit::isActive())
-        pViewFrame->GetWindow().SetLOKNotifier(this, true);
+    {
+        vcl::Window* pFrameWin = pViewFrame->GetWindow().GetFrameWindow();
+        if (pFrameWin)
+            pFrameWin->SetLOKNotifier(this, true);
+    }
 }
 
 
@@ -1105,8 +1109,9 @@ SfxViewShell::~SfxViewShell()
         pImpl->m_pController.clear();
     }
 
-    if (GetViewFrame()->GetWindow().GetLOKNotifier())
-        GetViewFrame()->GetWindow().ReleaseLOKNotifier();
+    vcl::Window* pFrameWin = GetViewFrame()->GetWindow().GetFrameWindow();
+    if (pFrameWin && pFrameWin->GetLOKNotifier())
+        pFrameWin->ReleaseLOKNotifier();
 }
 
 bool SfxViewShell::PrepareClose
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 74e84ba381fa..3e05a54f0b20 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -869,6 +869,12 @@ weld::Window* Window::GetFrameWeld() const
     return pFrame ? pFrame->GetFrameWeld() : nullptr;
 }
 
+vcl::Window* Window::GetFrameWindow() const
+{
+    SalFrame* pFrame = ImplGetFrame();
+    return pFrame ? pFrame->GetWindow() : nullptr;
+}
+
 vcl::Window* Window::ImplGetParent() const
 {
     return mpWindowImpl ? mpWindowImpl->mpParent.get() : nullptr;


More information about the Libreoffice-commits mailing list