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 : #ifdef _MSC_VER
21 : #pragma optimize ("", off)
22 : #endif
23 :
24 : #include <sfx2/childwin.hxx>
25 : #include <sfx2/request.hxx>
26 : #include <sfx2/viewfrm.hxx>
27 : #include <vcl/svapp.hxx>
28 : #include <vcl/wrkwin.hxx>
29 :
30 : #include "tabvwsh.hxx"
31 : #include "global.hxx"
32 : #include "scmod.hxx"
33 : #include "docsh.hxx"
34 : #include "sc.hrc"
35 :
36 :
37 : // STATIC DATA -----------------------------------------------------------
38 :
39 : //! Parent-Window fuer Dialoge
40 : //! Problem: OLE Server!
41 :
42 0 : Window* ScTabViewShell::GetDialogParent()
43 : {
44 : // if a ref-input dialog is open, use it as parent
45 : // (necessary when a slot is executed from the dialog's OK handler)
46 0 : if ( nCurRefDlgId && nCurRefDlgId == SC_MOD()->GetCurRefDlgId() )
47 : {
48 0 : SfxViewFrame* pViewFrm = GetViewFrame();
49 0 : if ( pViewFrm->HasChildWindow(nCurRefDlgId) )
50 : {
51 0 : SfxChildWindow* pChild = pViewFrm->GetChildWindow(nCurRefDlgId);
52 0 : if (pChild)
53 : {
54 0 : Window* pWin = pChild->GetWindow();
55 0 : if (pWin && pWin->IsVisible())
56 0 : return pWin;
57 : }
58 : }
59 : }
60 :
61 0 : ScDocShell* pDocSh = GetViewData()->GetDocShell();
62 0 : if ( pDocSh->IsOle() )
63 : {
64 : //TODO/LATER: how to GetEditWindow in embedded document?!
65 : //It should be OK to return the VieShell Window!
66 0 : return GetWindow();
67 : //SvInPlaceEnvironment* pEnv = pDocSh->GetIPEnv();
68 : //if (pEnv)
69 : // return pEnv->GetEditWin();
70 : }
71 :
72 0 : return GetActiveWin(); // for normal views, too
73 15 : }
74 :
75 :
76 :
77 :
78 :
79 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|