1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_dtrans.hxx"
26 
27 //------------------------------------------------------------------------
28 // includes
29 //------------------------------------------------------------------------
30 #include "..\..\inc\DtObjFactory.hxx"
31 
32 #ifndef _TWRAPPERDATAOBJECT_HXX_
33 #include "XTDataObject.hxx"
34 #endif
35 
36 #ifndef _DOWRAPPERTRANSFERABLE_HXX_
37 #include "DOTransferable.hxx"
38 #endif
39 
40 //------------------------------------------------------------------------
41 // namespace directives
42 //------------------------------------------------------------------------
43 
44 using namespace com::sun::star::uno;
45 using namespace com::sun::star::datatransfer;
46 using namespace com::sun::star::lang;
47 
48 //------------------------------------------------------------------------
49 // implementation
50 //------------------------------------------------------------------------
51 
createDataObjFromTransferable(const Reference<XMultiServiceFactory> & aServiceManager,const Reference<XTransferable> & refXTransferable)52 IDataObjectPtr SAL_CALL CDTransObjFactory::createDataObjFromTransferable(const Reference<XMultiServiceFactory>& aServiceManager,
53 																	   const Reference< XTransferable >& refXTransferable)
54 {
55 	return (IDataObjectPtr(new CXTDataObject(aServiceManager, refXTransferable)));
56 }
57 
createTransferableFromDataObj(const Reference<XMultiServiceFactory> & aServiceManager,IDataObjectPtr pIDataObject)58 Reference< XTransferable > SAL_CALL CDTransObjFactory::createTransferableFromDataObj( const Reference< XMultiServiceFactory >& aServiceManager,
59 																					 IDataObjectPtr pIDataObject )
60 {
61 	CDOTransferable* pTransf = new CDOTransferable(aServiceManager, pIDataObject);
62 	Reference<XTransferable> refDOTransf(pTransf);
63 
64 	pTransf->acquire();
65 	pTransf->initFlavorList();
66 	pTransf->release();
67 
68 	return refDOTransf;
69 }
70 
71