Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #include <sfx2/childwin.hxx>
21 : #include <sfx2/request.hxx>
22 : #include <sfx2/viewfrm.hxx>
23 : #include <vcl/svapp.hxx>
24 : #include <vcl/wrkwin.hxx>
25 :
26 : #include "tabvwsh.hxx"
27 : #include "global.hxx"
28 : #include "scmod.hxx"
29 : #include "docsh.hxx"
30 : #include "sc.hrc"
31 : #include <gridwin.hxx>
32 :
33 : // STATIC DATA -----------------------------------------------------------
34 :
35 : //! Parent-Window fuer Dialoge
36 : //! Problem: OLE Server!
37 :
38 230 : vcl::Window* ScTabViewShell::GetDialogParent()
39 : {
40 : // if a ref-input dialog is open, use it as parent
41 : // (necessary when a slot is executed from the dialog's OK handler)
42 230 : if ( nCurRefDlgId && nCurRefDlgId == SC_MOD()->GetCurRefDlgId() )
43 : {
44 0 : SfxViewFrame* pViewFrm = GetViewFrame();
45 0 : if ( pViewFrm->HasChildWindow(nCurRefDlgId) )
46 : {
47 0 : SfxChildWindow* pChild = pViewFrm->GetChildWindow(nCurRefDlgId);
48 0 : if (pChild)
49 : {
50 0 : vcl::Window* pWin = pChild->GetWindow();
51 0 : if (pWin && pWin->IsVisible())
52 0 : return pWin;
53 : }
54 : }
55 : }
56 :
57 230 : ScDocShell* pDocSh = GetViewData().GetDocShell();
58 230 : if ( pDocSh->IsOle() )
59 : {
60 : // TODO/LATER: how to GetEditWindow in embedded document?!
61 : // It should be OK to return the ViewShell Window!
62 0 : return GetWindow();
63 : // SvInPlaceEnvironment* pEnv = pDocSh->GetIPEnv();
64 : // if (pEnv)
65 : // return pEnv->GetEditWin();
66 : }
67 :
68 230 : return GetActiveWin(); // for normal views, too
69 156 : }
70 :
71 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|