xref: /aoo42x/main/sd/source/ui/func/fulink.cxx (revision 79aad27f)
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_sd.hxx"
26 
27 
28 #include "fulink.hxx"
29 
30 #include <sfx2/linkmgr.hxx>
31 #include <sfx2/bindings.hxx>
32 #include <sfx2/viewfrm.hxx>
33 
34 #include <svx/svxdlg.hxx>
35 
36 #ifndef SD_WINDOW_SHELL_HXX
37 #include "Window.hxx"
38 #endif
39 #include "drawdoc.hxx"
40 #include "ViewShell.hxx"
41 #include "app.hrc"
42 
43 
44 class SfxRequest;
45 
46 namespace sd {
47 
48 TYPEINIT1( FuLink, FuPoor );
49 
50 /*************************************************************************
51 |*
52 |* Konstruktor
53 |*
54 \************************************************************************/
55 
FuLink(ViewShell * pViewSh,::sd::Window * pWin,::sd::View * pView,SdDrawDocument * pDoc,SfxRequest & rReq)56 FuLink::FuLink (
57     ViewShell* pViewSh,
58     ::sd::Window* pWin,
59     ::sd::View* pView,
60     SdDrawDocument* pDoc,
61     SfxRequest& rReq )
62     : FuPoor(pViewSh, pWin, pView, pDoc, rReq)
63 {
64 }
65 
Create(ViewShell * pViewSh,::sd::Window * pWin,::sd::View * pView,SdDrawDocument * pDoc,SfxRequest & rReq)66 FunctionReference FuLink::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
67 {
68 	FunctionReference xFunc( new FuLink( pViewSh, pWin, pView, pDoc, rReq ) );
69 	xFunc->DoExecute(rReq);
70 	return xFunc;
71 }
72 
DoExecute(SfxRequest &)73 void FuLink::DoExecute( SfxRequest& )
74 {
75 	sfx2::LinkManager* pLinkManager = mpDoc->GetLinkManager();
76 
77     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
78     SfxAbstractLinksDialog* pDlg = pFact->CreateLinksDialog( mpViewShell->GetActiveWindow(), pLinkManager );
79     if ( pDlg )
80     {
81         pDlg->Execute();
82         mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_MANAGE_LINKS );
83         delete pDlg;
84     }
85 }
86 
87 
88 } // end of namespace sd
89