1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "iipaobj.hxx"
21 #include "embeddoc.hxx"
25 CIIAObj::CIIAObj(DocumentHolder
* pDocHolder
)
27 m_rDocHolder( pDocHolder
)
37 /* IUnknown methods */
39 STDMETHODIMP
CIIAObj::QueryInterface(REFIID riid
, LPVOID FAR
*ppv
)
43 if(IID_IUnknown
==riid
||
44 IID_IOleWindow
==riid
||
45 IID_IOleInPlaceActiveObject
==riid
)
48 //AddRef any interface we'll return.
51 ((LPUNKNOWN
)*ppv
)->AddRef();
55 return ResultFromScode(E_NOINTERFACE
);
59 STDMETHODIMP_(ULONG
) CIIAObj::AddRef(void)
61 return osl_atomic_increment( &m_refCount
);
64 STDMETHODIMP_(ULONG
) CIIAObj::Release(void)
66 sal_Int32 nCount
= osl_atomic_decrement( &m_refCount
);
73 /* IOleInPlaceActiveObject methods*/
75 STDMETHODIMP
CIIAObj::GetWindow(HWND
*)
80 STDMETHODIMP
CIIAObj::ContextSensitiveHelp(BOOL
)
85 STDMETHODIMP
CIIAObj::TranslateAccelerator(LPMSG
)
90 STDMETHODIMP
CIIAObj::OnFrameWindowActivate(BOOL
)
95 STDMETHODIMP
CIIAObj::OnDocWindowActivate(BOOL
)
100 STDMETHODIMP
CIIAObj::ResizeBorder(
101 LPCRECT pRect
,LPOLEINPLACEUIWINDOW
,BOOL bFrame
)
103 if(!bFrame
) return NOERROR
;
105 if ( !m_rDocHolder
.is() )
108 return m_rDocHolder
->SetContRects(pRect
);
112 STDMETHODIMP
CIIAObj::EnableModeless(BOOL
)
117 // Fix strange warnings about some
118 // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions.
119 // warning C4505: 'xxx' : unreferenced local function has been removed
120 #if defined(_MSC_VER)
121 #pragma warning(disable: 4505)
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */