merge the formfield patch from ooo-build
[ooovba.git] / sc / source / ui / view / tabvwshd.cxx
blob2e420c53ff36d1b2949af9ea97d2d36c83c5a1f8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tabvwshd.cxx,v $
10 * $Revision: 1.7 $
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 //------------------------------------------------------------------
38 #ifdef _MSC_VER
39 #pragma optimize ("", off)
40 #endif
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"
51 #include "global.hxx"
52 #include "scmod.hxx"
53 #include "docsh.hxx"
54 #include "sc.hrc"
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);
77 if (pChild)
79 Window* pWin = pChild->GetWindow();
80 if (pWin && pWin->IsVisible())
81 return pWin;
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!
91 return GetWindow();
92 //SvInPlaceEnvironment* pEnv = pDocSh->GetIPEnv();
93 //if (pEnv)
94 // return pEnv->GetEditWin();
97 return GetActiveWin(); // for normal views, too