diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-01-10 10:47:37 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-01-10 09:52:53 +0100 |
commit | 24c4f84c33cef84672a37810009081cd6fca5309 (patch) | |
tree | d069fe4c438f1595aab60e690c148389af4ff577 /desktop | |
parent | c6c92d01e6f6d8a962c9f452e8fb32cb3e3a41b1 (diff) |
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@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 102 |
1 files changed, 51 insertions, 51 deletions
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; |