merge the formfield patch from ooo-build
[ooovba.git] / dtrans / source / win32 / dnd / targetdragcontext.cxx
blob4a8f16334277ede58749362905cb91769d14bc58
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: targetdragcontext.cxx,v $
10 * $Revision: 1.8 $
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_dtrans.hxx"
33 #include <rtl/unload.h>
35 #include "targetdragcontext.hxx"
37 extern rtl_StandardModuleCount g_moduleCount;
38 TargetDragContext::TargetDragContext( DropTarget* p)
40 g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
41 m_pDropTarget= p;
42 p->acquire();
45 TargetDragContext::~TargetDragContext()
47 m_pDropTarget->release();
48 g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
51 void SAL_CALL TargetDragContext::acceptDrag( sal_Int8 dragOperation )
52 throw( RuntimeException)
54 m_pDropTarget->_acceptDrag( dragOperation, static_cast<XDropTargetDragContext*>( this) );
57 void SAL_CALL TargetDragContext::rejectDrag( )
58 throw( RuntimeException)
60 m_pDropTarget->_rejectDrag( static_cast<XDropTargetDragContext*>( this) );