1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tabvwshd.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
36 //------------------------------------------------------------------
39 #pragma optimize ("", off)
42 // INCLUDE ---------------------------------------------------------------
44 #include <sfx2/childwin.hxx>
45 #include <sfx2/request.hxx>
46 #include <sfx2/topfrm.hxx>
47 #include <vcl/svapp.hxx>
48 #include <vcl/wrkwin.hxx>
50 #include "tabvwsh.hxx"
57 // STATIC DATA -----------------------------------------------------------
59 //------------------------------------------------------------------
61 #define IS_AVAILABLE(WhichId,ppItem) \
62 (pReqArgs->GetItemState((WhichId), TRUE, ppItem ) == SFX_ITEM_SET)
64 //! Parent-Window fuer Dialoge
65 //! Problem: OLE Server!
67 Window
* ScTabViewShell::GetDialogParent()
69 // #95513# if a ref-input dialog is open, use it as parent
70 // (necessary when a slot is executed from the dialog's OK handler)
71 if ( nCurRefDlgId
&& nCurRefDlgId
== SC_MOD()->GetCurRefDlgId() )
73 SfxViewFrame
* pViewFrm
= GetViewFrame();
74 if ( pViewFrm
->HasChildWindow(nCurRefDlgId
) )
76 SfxChildWindow
* pChild
= pViewFrm
->GetChildWindow(nCurRefDlgId
);
79 Window
* pWin
= pChild
->GetWindow();
80 if (pWin
&& pWin
->IsVisible())
86 ScDocShell
* pDocSh
= GetViewData()->GetDocShell();
87 if ( pDocSh
->IsOle() )
89 //TODO/LATER: how to GetEditWindow in embedded document?!
90 //It should be OK to return the VieShell Window!
92 //SvInPlaceEnvironment* pEnv = pDocSh->GetIPEnv();
94 // return pEnv->GetEditWin();
97 return GetActiveWin(); // for normal views, too