Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <svl/urlbmk.hxx>
30 : :
31 : : #include "lnktrans.hxx"
32 : : #include "scmod.hxx"
33 : :
34 : : using namespace com::sun::star;
35 : :
36 : : // -----------------------------------------------------------------------
37 : :
38 [ # # ][ # # ]: 0 : ScLinkTransferObj::ScLinkTransferObj()
39 : : {
40 : 0 : }
41 : :
42 [ # # ][ # # ]: 0 : ScLinkTransferObj::~ScLinkTransferObj()
43 : : {
44 [ # # ]: 0 : }
45 : :
46 : 0 : void ScLinkTransferObj::SetLinkURL( const String& rURL, const String& rText )
47 : : {
48 : 0 : aLinkURL = rURL;
49 : 0 : aLinkText = rText;
50 : 0 : }
51 : :
52 : 0 : void ScLinkTransferObj::AddSupportedFormats()
53 : : {
54 [ # # ]: 0 : if ( aLinkURL.Len() )
55 : : {
56 : : // TransferableHelper::SetINetBookmark formats
57 : :
58 : 0 : AddFormat( SOT_FORMATSTR_ID_SOLK );
59 : 0 : AddFormat( SOT_FORMAT_STRING );
60 : 0 : AddFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR );
61 : 0 : AddFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK );
62 : 0 : AddFormat( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR );
63 : 0 : AddFormat( SOT_FORMATSTR_ID_FILECONTENT );
64 : : }
65 : 0 : }
66 : :
67 : 0 : sal_Bool ScLinkTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
68 : : {
69 : 0 : sal_Bool bOK = false;
70 [ # # ]: 0 : if ( aLinkURL.Len() )
71 : : {
72 [ # # ]: 0 : INetBookmark aBmk( aLinkURL, aLinkText );
73 [ # # ][ # # ]: 0 : bOK = SetINetBookmark( aBmk, rFlavor );
74 : : }
75 : 0 : return bOK;
76 : : }
77 : :
78 : 0 : void ScLinkTransferObj::ObjectReleased()
79 : : {
80 : 0 : TransferableHelper::ObjectReleased();
81 : 0 : }
82 : :
83 : 0 : void ScLinkTransferObj::DragFinished( sal_Int8 nDropAction )
84 : : {
85 : 0 : ScModule* pScMod = SC_MOD();
86 : 0 : pScMod->ResetDragObject();
87 : :
88 : 0 : TransferableHelper::DragFinished( nDropAction );
89 : 0 : }
90 : :
91 : :
92 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|