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: iipaobj.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 #include "iipaobj.hxx"
32 #include "embeddoc.hxx"
36 CIIAObj::CIIAObj(DocumentHolder
* pDocHolder
)
38 m_rDocHolder( pDocHolder
)
48 /* IUnknown methods */
50 STDMETHODIMP
CIIAObj::QueryInterface(REFIID riid
, LPVOID FAR
*ppv
)
54 if(IID_IUnknown
==riid
||
55 IID_IOleWindow
==riid
||
56 IID_IOleInPlaceActiveObject
==riid
)
59 //AddRef any interface we'll return.
62 ((LPUNKNOWN
)*ppv
)->AddRef();
66 return ResultFromScode(E_NOINTERFACE
);
70 STDMETHODIMP_(ULONG
) CIIAObj::AddRef(void)
72 return osl_incrementInterlockedCount( &m_refCount
);
75 STDMETHODIMP_(ULONG
) CIIAObj::Release(void)
77 sal_Int32 nCount
= osl_decrementInterlockedCount( &m_refCount
);
84 /* IOleInPlaceActiveObject methods*/
86 STDMETHODIMP
CIIAObj::GetWindow(HWND
*)
91 STDMETHODIMP
CIIAObj::ContextSensitiveHelp(BOOL
)
96 STDMETHODIMP
CIIAObj::TranslateAccelerator(LPMSG
)
101 STDMETHODIMP
CIIAObj::OnFrameWindowActivate(BOOL
)
106 STDMETHODIMP
CIIAObj::OnDocWindowActivate(BOOL
)
111 STDMETHODIMP
CIIAObj::ResizeBorder(
112 LPCRECT pRect
,LPOLEINPLACEUIWINDOW
,BOOL bFrame
)
114 if(!bFrame
) return NOERROR
;
116 if ( !m_rDocHolder
.is() )
119 return m_rDocHolder
->SetContRects(pRect
);
123 STDMETHODIMP
CIIAObj::EnableModeless(BOOL
)
128 // Fix strange warnings about some
129 // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions.
130 // warning C4505: 'xxx' : unreferenced local function has been removed
131 #if defined(_MSC_VER)
132 #pragma warning(disable: 4505)