tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / view / tabvwshd.cxx
blobb874d46bb1ccec674b043019fcb337dc7d9867e7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sfx2/childwin.hxx>
21 #include <sfx2/viewfrm.hxx>
23 #include <tabvwsh.hxx>
24 #include <scmod.hxx>
25 #include <docsh.hxx>
26 #include <gridwin.hxx>
28 //! parent window for dialogs
29 //! Problem: OLE Server!
31 weld::Window* ScTabViewShell::GetDialogParent()
33 // if a ref-input dialog is open, use it as parent
34 // (necessary when a slot is executed from the dialog's OK handler)
35 if (nCurRefDlgId && nCurRefDlgId == ScModule::get()->GetCurRefDlgId())
37 SfxViewFrame& rViewFrm = GetViewFrame();
38 if (rViewFrm.HasChildWindow(nCurRefDlgId))
40 SfxChildWindow* pChild = rViewFrm.GetChildWindow(nCurRefDlgId);
41 if (pChild)
43 auto xController = pChild->GetController();
44 weld::Window* pRet = xController ? xController->getDialog() : nullptr;
45 if (pRet && pRet->get_visible())
46 return pRet;
51 ScDocShell* pDocSh = GetViewData().GetDocShell();
52 if (pDocSh->IsOle())
54 // TODO/LATER: how to GetEditWindow in embedded document?!
55 // It should be OK to return the ViewShell Window!
56 vcl::Window* pWin = GetWindow();
57 return pWin ? pWin->GetFrameWeld() : nullptr;
58 // SvInPlaceEnvironment* pEnv = pDocSh->GetIPEnv();
59 // if (pEnv)
60 // return pEnv->GetEditWin();
63 vcl::Window* pWin = GetActiveWin(); // for normal views, too
64 return pWin ? pWin->GetFrameWeld() : nullptr;
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */