1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #include "embeddoc.hxx" 29 #include <osl/diagnose.h> 30 31 32 STDMETHODIMP EmbedDocument_Impl::GetWindow(HWND *hWnd) 33 { 34 OSL_ENSURE(m_pDocHolder,"no document for inplace activation"); 35 36 *hWnd = m_pDocHolder->GetTopMostWinHandle(); 37 if(*hWnd != NULL) 38 return NOERROR; 39 else 40 return ERROR; 41 } 42 43 STDMETHODIMP EmbedDocument_Impl::ContextSensitiveHelp(BOOL) 44 { 45 return NOERROR; 46 } 47 48 STDMETHODIMP EmbedDocument_Impl::InPlaceDeactivate(void) 49 { 50 // no locking is used since the OLE must use the same thread always 51 if ( m_bIsInVerbHandling ) 52 return E_UNEXPECTED; 53 54 BooleanGuard_Impl aGuard( m_bIsInVerbHandling ); 55 56 m_pDocHolder->InPlaceDeactivate(); 57 58 // the inplace object needs the notification after the storing ( on deactivating ) 59 // if it happens before the storing the replacement might not be updated 60 notify(); 61 62 return NOERROR; 63 } 64 65 STDMETHODIMP EmbedDocument_Impl::UIDeactivate(void) 66 { 67 // no locking is used since the OLE must use the same thread always 68 if ( m_bIsInVerbHandling ) 69 return E_UNEXPECTED; 70 71 BooleanGuard_Impl aGuard( m_bIsInVerbHandling ); 72 73 74 m_pDocHolder->UIDeactivate(); 75 76 // the inplace object needs the notification after the storing ( on deactivating ) 77 // if it happens before the storing the replacement might not be updated 78 notify(); 79 80 return NOERROR; 81 } 82 83 STDMETHODIMP EmbedDocument_Impl::SetObjectRects(LPCRECT aRect, LPCRECT aClip) 84 { 85 OSL_ENSURE(m_pDocHolder,"no document for inplace activation"); 86 87 return m_pDocHolder->SetObjectRects(aRect,aClip); 88 } 89 90 STDMETHODIMP EmbedDocument_Impl::ReactivateAndUndo(void) 91 { 92 return E_NOTIMPL; 93 } 94 95 // Fix strange warnings about some 96 // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions. 97 // warning C4505: 'xxx' : unreferenced local function has been removed 98 #if defined(_MSC_VER) 99 #pragma warning(disable: 4505) 100 #endif 101