merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0504-linkwarn-dlg-in-apps.diff
blob4c8c224aee1794a854f7b9ac2ac6a89a64ad7136
1 --- sw/source/ui/uiview/view2.cxx 2008-04-10 23:49:38.000000000 +0200
2 +++ sw/source/ui/uiview/view2.cxx 2008-05-07 18:39:44.000000000 +0200
3 @@ -61,6 +61,7 @@
4 #include <caption.hxx>
5 #include <svtools/PasswordHelper.hxx>
6 #include <svtools/urihelper.hxx>
7 +#include <svtools/miscopt.hxx>
8 #include <sfx2/passwd.hxx>
9 #include <sfx2/sfxdlg.hxx>
10 #include <sfx2/filedlghelper.hxx>
11 @@ -68,6 +69,7 @@
12 #include <svx/langitem.hxx>
13 #include <svx/viewlayoutitem.hxx>
14 #include <svx/zoomslideritem.hxx>
15 +#include <svx/linkwarn.hxx>
16 #include <svx/htmlmode.hxx>
17 #ifndef _APP_HXX //autogen
18 #include <vcl/svapp.hxx>
19 @@ -462,6 +464,14 @@
20 rReq.AppendItem( SfxStringItem( FN_PARAM_2, sGraphicFormat ) );
21 rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) );
24 + // really store as link only?
25 + if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
26 + {
27 + SvxLinkWarningDialog aWarnDlg(GetWindow(),pFileDlg->GetPath());
28 + if( aWarnDlg.Execute() != RET_OK )
29 + bAsLink=sal_False; // don't store as link
30 + }
33 SwWrtShell& rSh = GetWrtShell();
34 --- sc/source/ui/drawfunc/fuins1.cxx 2008-04-11 00:23:00.000000000 +0200
35 +++ sc/source/ui/drawfunc/fuins1.cxx 2008-05-07 18:40:07.000000000 +0200
36 @@ -42,8 +42,10 @@
37 #include <svx/svdpage.hxx>
38 #include <svx/svdpagv.hxx>
39 #include <svx/svdview.hxx>
40 +#include <svx/linkwarn.hxx>
41 #include <svtools/filter.hxx>
42 #include <svtools/stritem.hxx>
43 +#include <svtools/miscopt.hxx>
44 #include <vcl/msgbox.hxx>
45 #include <tools/urlobj.hxx>
46 #include <avmedia/mediawindow.hxx>
47 @@ -297,6 +299,14 @@
48 String aFilterName = aDlg.GetCurrentFilter();
49 BOOL bAsLink = aDlg.IsAsLink();
51 + // really store as link only?
52 + if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
53 + {
54 + SvxLinkWarningDialog aWarnDlg(pWin,aFileName);
55 + if( aWarnDlg.Execute() != RET_OK )
56 + bAsLink = sal_False; // don't store as link
57 + }
59 lcl_InsertGraphic( aGraphic, aFileName, aFilterName, bAsLink, FALSE, pViewSh, pWindow, pView );
61 // append items for recording
62 --- sd/source/ui/func/fuinsert.cxx 2008-04-10 22:20:15.000000000 +0200
63 +++ sd/source/ui/func/fuinsert.cxx 2008-05-07 18:13:46.000000000 +0200
64 @@ -51,9 +51,11 @@
65 #include <sfx2/request.hxx>
66 #include <svtools/globalnameitem.hxx>
67 #include <svtools/pathoptions.hxx>
68 +#include <svtools/miscopt.hxx>
69 #include <svx/pfiledlg.hxx>
70 #include <svx/impgrf.hxx>
71 #include <svx/dialogs.hrc>
72 +#include <svx/linkwarn.hxx>
73 #include <svx/linkmgr.hxx>
74 #include <svx/svdetc.hxx>
75 #include <avmedia/mediawindow.hxx>
76 @@ -178,7 +180,15 @@
78 if(pGrafObj && aDlg.IsAsLink())
80 - // store link only?
81 + // really store as link only?
82 + if( SvtMiscOptions().ShowLinkWarningDialog() )
83 + {
84 + SvxLinkWarningDialog aWarnDlg(mpWindow,aDlg.GetPath());
85 + if( aWarnDlg.Execute() != RET_OK )
86 + return; // don't store as link
87 + }
89 + // store as link
90 String aFltName(aDlg.GetCurrentFilter());
91 String aPath(aDlg.GetPath());
92 pGrafObj->SetGraphicLink(aPath, aFltName);