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

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 10 08:53:22 UTC 2020


 desktop/source/lib/init.cxx |  102 ++++++++++++++++++++++----------------------
 1 file changed, 51 insertions(+), 51 deletions(-)

New commits:
commit 24c4f84c33cef84672a37810009081cd6fca5309
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Jan 10 10:47:37 2020 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Jan 10 09:52:53 2020 +0100

    Fix --enable-werror build
    
    ... producing this error in MSVC2017:
    
    C:/lo/src/core2/desktop/source/lib/init.cxx(3486): error C2220: warning treated as error - no 'object' file generated
    C:/lo/src/core2/desktop/source/lib/init.cxx(3486): warning C4190: 'getSidebarWindow' has C-linkage specified, but returns UDT 'VclPtr<vcl::Window>' which is incompatible with C
    C:\lo\src\core2\include\vcl/cursor.hxx(49): note: see declaration of 'VclPtr<vcl::Window>'
    
    ... because getSidebarWindow was inside 'extern "C"' block.
    
    Change-Id: If7364555d09f0955ac90ce127b19ce4bbdb5cc3c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86518
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ee258f499384..c0aa5919e41c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1112,6 +1112,57 @@ rtl::Reference<LOKClipboard> forceSetClipboardForCurrentView(LibreOfficeKitDocum
 
 #endif
 
+void setupSidebar(bool bShow)
+{
+    SfxViewShell* pViewShell = SfxViewShell::Current();
+    SfxViewFrame* pViewFrame = pViewShell ? pViewShell->GetViewFrame() : nullptr;
+    if (pViewFrame)
+    {
+        if (bShow && !pViewFrame->GetChildWindow(SID_SIDEBAR))
+            pViewFrame->SetChildWindow(SID_SIDEBAR, false /* create it */, true /* focus */);
+
+        pViewFrame->ShowChildWindow(SID_SIDEBAR, bShow);
+
+        if (!bShow)
+            return;
+
+        // Force synchronous population of panels
+        SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
+        if (!pChild)
+            return;
+
+        auto pDockingWin = dynamic_cast<sfx2::sidebar::SidebarDockingWindow *>(pChild->GetWindow());
+        if (!pDockingWin)
+            return;
+        pDockingWin->SyncUpdate();
+    }
+    else
+        SetLastExceptionMsg("No view shell or sidebar");
+}
+
+VclPtr<Window> getSidebarWindow()
+{
+    VclPtr<Window> xRet;
+
+    setupSidebar(true);
+    SfxViewShell* pViewShell = SfxViewShell::Current();
+    SfxViewFrame* pViewFrame = pViewShell ? pViewShell->GetViewFrame() : nullptr;
+    if (!pViewFrame)
+        return xRet;
+
+    // really a SidebarChildWindow
+    SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
+    if (!pChild)
+        return xRet;
+
+    // really a SidebarDockingWindow
+    vcl::Window *pWin = pChild->GetWindow();
+    if (!pWin)
+        return xRet;
+    xRet = pWin;
+    return xRet;
+}
+
 } // anonymous namespace
 
 LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent)
@@ -3454,57 +3505,6 @@ public:
     virtual void SAL_CALL disposing(const css::lang::EventObject&) override {}
 };
 
-static void setupSidebar(bool bShow)
-{
-    SfxViewShell* pViewShell = SfxViewShell::Current();
-    SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): nullptr;
-    if (pViewFrame)
-    {
-        if (bShow && !pViewFrame->GetChildWindow(SID_SIDEBAR))
-            pViewFrame->SetChildWindow(SID_SIDEBAR, false /* create it */, true /* focus */);
-
-        pViewFrame->ShowChildWindow(SID_SIDEBAR, bShow);
-
-        if (!bShow)
-            return;
-
-        // Force synchronous population of panels
-        SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
-        if (!pChild)
-            return;
-
-        auto pDockingWin = dynamic_cast<sfx2::sidebar::SidebarDockingWindow *>(pChild->GetWindow());
-        if (!pDockingWin)
-            return;
-        pDockingWin->SyncUpdate();
-    }
-    else
-        SetLastExceptionMsg("No view shell or sidebar");
-}
-
-static VclPtr<Window> getSidebarWindow()
-{
-    VclPtr<Window> xRet;
-
-    setupSidebar(true);
-    SfxViewShell* pViewShell = SfxViewShell::Current();
-    SfxViewFrame* pViewFrame = pViewShell? pViewShell->GetViewFrame(): nullptr;
-    if (!pViewFrame)
-        return xRet;
-
-    // really a SidebarChildWindow
-    SfxChildWindow *pChild = pViewFrame->GetChildWindow(SID_SIDEBAR);
-    if (!pChild)
-        return xRet;
-
-    // really a SidebarDockingWindow
-    vcl::Window *pWin = pChild->GetWindow();
-    if (!pWin)
-        return xRet;
-    xRet = pWin;
-    return xRet;
-}
-
 static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWindowId, const char* pArguments)
 {
     SolarMutexGuard aGuard;


More information about the Libreoffice-commits mailing list